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 ⇒ Capture
constructor
A new instance of Capture.
Constructor Details
#initialize ⇒ Capture
Returns a new instance of Capture.
4239 4240 4241 4242 4243 4244 |
# File 'lib/packcr/parser.rb', line 4239 def initialize @range_start = 0 @range_end = 0 @start_loc = Location.new @end_loc = Location.new end |
Instance Attribute Details
#end_loc ⇒ Object
Returns the value of attribute end_loc.
4237 4238 4239 |
# File 'lib/packcr/parser.rb', line 4237 def end_loc @end_loc end |
#range_end ⇒ Object
Returns the value of attribute range_end.
4236 4237 4238 |
# File 'lib/packcr/parser.rb', line 4236 def range_end @range_end end |
#range_start ⇒ Object
Returns the value of attribute range_start.
4236 4237 4238 |
# File 'lib/packcr/parser.rb', line 4236 def range_start @range_start end |
#start_loc ⇒ Object
Returns the value of attribute start_loc.
4237 4238 4239 |
# File 'lib/packcr/parser.rb', line 4237 def start_loc @start_loc end |
Instance Method Details
#capture_string(buffer) ⇒ Object
4246 4247 4248 |
# File 'lib/packcr/parser.rb', line 4246 def capture_string(buffer) @string ||= buffer[@range_start, @range_end - @range_start] end |