Class: Packcr::Tokenizer::Capture

Inherits:
Object
  • Object
show all
Defined in:
lib/packcr/tokenizer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_endObject

Returns the value of attribute range_end.



2905
2906
2907
# File 'lib/packcr/tokenizer.rb', line 2905

def range_end
  @range_end
end

#range_startObject

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