Method: Parser::Source::Range#with

Defined in:
lib/parser/source/range.rb

#with(begin_pos: @begin_pos, end_pos: @end_pos) ⇒ Range

to the given value(s).

Parameters:

  • Endpoint(s) (Hash)

    to change, any combination of :begin_pos or :end_pos

Returns:

  • (Range)

    the same range as this range but with the given end point(s) changed

[View source]

184
185
186
# File 'lib/parser/source/range.rb', line 184

def with(begin_pos: @begin_pos, end_pos: @end_pos)
  Range.new(@source_buffer, begin_pos, end_pos)
end