Class: Position
- Inherits:
-
Object
- Object
- Position
- Defined in:
- lib/ast.rb
Instance Attribute Summary collapse
-
#start ⇒ Object
readonly
Returns the value of attribute start.
-
#stop ⇒ Object
readonly
Returns the value of attribute stop.
Instance Method Summary collapse
-
#initialize(start, stop) ⇒ Position
constructor
A new instance of Position.
- #to_s ⇒ Object
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
#start ⇒ Object (readonly)
Returns the value of attribute start.
15 16 17 |
# File 'lib/ast.rb', line 15 def start @start end |
#stop ⇒ Object (readonly)
Returns the value of attribute stop.
15 16 17 |
# File 'lib/ast.rb', line 15 def stop @stop end |
Instance Method Details
#to_s ⇒ Object
23 24 25 |
# File 'lib/ast.rb', line 23 def to_s @start.to_s end |