Class: Savage::Direction
- Inherits:
-
Object
- Object
- Savage::Direction
- Includes:
- Utils
- Defined in:
- lib/savage/direction.rb
Direct Known Subclasses
Savage::Directions::ClosePath, Savage::Directions::CoordinateTarget, Savage::Directions::PointTarget
Instance Method Summary collapse
- #absolute? ⇒ Boolean
-
#initialize(absolute) ⇒ Direction
constructor
A new instance of Direction.
- #to_command ⇒ Object
Methods included from Utils
Constructor Details
#initialize(absolute) ⇒ Direction
Returns a new instance of Direction.
10 11 12 |
# File 'lib/savage/direction.rb', line 10 def initialize(absolute) @absolute = absolute end |
Instance Method Details
#absolute? ⇒ Boolean
14 15 16 |
# File 'lib/savage/direction.rb', line 14 def absolute? @absolute end |
#to_command ⇒ Object
18 19 20 21 |
# File 'lib/savage/direction.rb', line 18 def to_command arr = to_a arr[0] + arr[1..-1].join(' ').gsub(/ -/,'-') end |