Class: Packcr::Tokenizer::Capture
- Inherits:
-
Object
- Object
- Packcr::Tokenizer::Capture
- Defined in:
- lib/packcr/tokenizer.rb
Instance Attribute Summary collapse
-
#range_end ⇒ Object
Returns the value of attribute range_end.
-
#range_start ⇒ Object
Returns the value of attribute range_start.
Instance Method Summary collapse
- #capture_string(buffer) ⇒ Object
-
#initialize(range_start = 0, range_end = 0) ⇒ Capture
constructor
A new instance of Capture.
Constructor Details
#initialize(range_start = 0, range_end = 0) ⇒ Capture
Returns a new instance of Capture.
2907 2908 2909 2910 |
# File 'lib/packcr/tokenizer.rb', line 2907 def initialize(range_start = 0, range_end = 0) @range_start = range_start @range_end = range_end end |
Instance Attribute Details
#range_end ⇒ Object
Returns the value of attribute range_end.
2905 2906 2907 |
# File 'lib/packcr/tokenizer.rb', line 2905 def range_end @range_end end |
#range_start ⇒ Object
Returns the value of attribute range_start.
2905 2906 2907 |
# File 'lib/packcr/tokenizer.rb', line 2905 def range_start @range_start end |
Instance Method Details
#capture_string(buffer) ⇒ Object
2912 2913 2914 |
# File 'lib/packcr/tokenizer.rb', line 2912 def capture_string(buffer) @string ||= buffer[@range_start, @range_end - @range_start] end |