Class: Packcr::Parser::Capture
- Inherits:
-
Object
- Object
- Packcr::Parser::Capture
- Defined in:
- lib/packcr/parser.rb
Instance Attribute Summary collapse
-
#end_loc ⇒ Object
Returns the value of attribute end_loc.
-
#range_end ⇒ Object
Returns the value of attribute range_end.
-
#range_start ⇒ Object
Returns the value of attribute range_start.
-
#start_loc ⇒ Object
Returns the value of attribute start_loc.
Instance Method Summary collapse
- #capture_string(buffer) ⇒ Object
-
#initialize(range_start = 0, range_end = 0, start_loc = nil, end_loc = nil) ⇒ Capture
constructor
A new instance of Capture.
Constructor Details
#initialize(range_start = 0, range_end = 0, start_loc = nil, end_loc = nil) ⇒ Capture
Returns a new instance of Capture.
4873 4874 4875 4876 4877 4878 |
# File 'lib/packcr/parser.rb', line 4873 def initialize(range_start = 0, range_end = 0, start_loc = nil, end_loc = nil) @range_start = range_start @range_end = range_end @start_loc = start_loc || Location.new @end_loc = end_loc || Location.new end |
Instance Attribute Details
#end_loc ⇒ Object
Returns the value of attribute end_loc.
4871 4872 4873 |
# File 'lib/packcr/parser.rb', line 4871 def end_loc @end_loc end |
#range_end ⇒ Object
Returns the value of attribute range_end.
4871 4872 4873 |
# File 'lib/packcr/parser.rb', line 4871 def range_end @range_end end |
#range_start ⇒ Object
Returns the value of attribute range_start.
4871 4872 4873 |
# File 'lib/packcr/parser.rb', line 4871 def range_start @range_start end |
#start_loc ⇒ Object
Returns the value of attribute start_loc.
4871 4872 4873 |
# File 'lib/packcr/parser.rb', line 4871 def start_loc @start_loc end |
Instance Method Details
#capture_string(buffer) ⇒ Object
4880 4881 4882 |
# File 'lib/packcr/parser.rb', line 4880 def capture_string(buffer) @capture_string ||= buffer[@range_start, @range_end - @range_start] end |