Class: Position

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(start, stop) ⇒ Position

Returns a new instance of Position.



17
18
19
20
21
# File 'lib/ast.rb', line 17

def initialize start, stop
	raise "Filename should be the same." if start.file_name != stop.file_name
	@start = start
	@stop = stop
end

Instance Attribute Details

#startObject (readonly)

Returns the value of attribute start.



15
16
17
# File 'lib/ast.rb', line 15

def start
  @start
end

#stopObject (readonly)

Returns the value of attribute stop.



15
16
17
# File 'lib/ast.rb', line 15

def stop
  @stop
end

Instance Method Details

#to_sObject



23
24
25
# File 'lib/ast.rb', line 23

def to_s
	@start.to_s
end