Class: LibRubyParser::Loc

Inherits:
Object
  • Object
show all
Defined in:
lib/lib-ruby-parser.rb

Overview

Representation of any location in the given input

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**options) ⇒ Loc

Returns a new instance of Loc.

Parameters:

  • options (Hash)

Options Hash (**options):

  • :begin (Integer)
  • :end (Integer)


19
20
21
22
# File 'lib/lib-ruby-parser.rb', line 19

def initialize(**options)
  @begin = options[:begin] || 0
  @end = options[:end] || 0
end

Instance Attribute Details

#beginInteger

Begin of the Loc range

Returns:

  • (Integer)


9
10
11
# File 'lib/lib-ruby-parser.rb', line 9

def begin
  @begin
end

#endInteger

End of the Loc range

Returns:

  • (Integer)


14
15
16
# File 'lib/lib-ruby-parser.rb', line 14

def end
  @end
end