Class: CCEngine::Location::Position
- Inherits:
-
Object
- Object
- CCEngine::Location::Position
- Defined in:
- lib/cc_engine/location/position.rb
Instance Method Summary collapse
-
#initialize(path:, start_position:, end_position:) ⇒ Position
constructor
A new instance of Position.
- #to_hash ⇒ Object
Constructor Details
#initialize(path:, start_position:, end_position:) ⇒ Position
Returns a new instance of Position.
4 5 6 7 8 |
# File 'lib/cc_engine/location/position.rb', line 4 def initialize(path:, start_position:, end_position:) @path = path @start_position = start_position @end_position = end_position end |
Instance Method Details
#to_hash ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/cc_engine/location/position.rb', line 10 def to_hash { path: path, positions: { begin: start_position.to_hash, end: end_position.to_hash } } end |