Method: Parser::Source::Range#initialize
- Defined in:
- lib/parser/source/range.rb
permalink #initialize(source_buffer, begin_pos, end_pos) ⇒ Range
Returns a new instance of Range.
37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/parser/source/range.rb', line 37 def initialize(source_buffer, begin_pos, end_pos) if end_pos < begin_pos raise ArgumentError, 'Parser::Source::Range: end_pos must not be less than begin_pos' end if source_buffer.nil? raise ArgumentError, 'Parser::Source::Range: source_buffer must not be nil' end @source_buffer = source_buffer @begin_pos, @end_pos = begin_pos, end_pos freeze end |