Class: Savage::Directions::PointTarget

Inherits:
Savage::Direction show all
Defined in:
lib/savage/directions/point_target.rb

Direct Known Subclasses

ArcTo, LineTo, MoveTo, QuadraticCurveTo

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Savage::Direction

#absolute?, #to_command

Methods included from Utils

#bool_to_int

Constructor Details

#initialize(x, y, absolute = true) ⇒ PointTarget

Returns a new instance of PointTarget.



7
8
9
10
# File 'lib/savage/directions/point_target.rb', line 7

def initialize(x, y, absolute=true)
  @target = Point.new(x,y)
  super(absolute)
end

Instance Attribute Details

#targetObject

Returns the value of attribute target.



5
6
7
# File 'lib/savage/directions/point_target.rb', line 5

def target
  @target
end

Instance Method Details

#to_aObject



12
13
14
# File 'lib/savage/directions/point_target.rb', line 12

def to_a
  [command_code, @target.x, @target.y]
end