class DYI::Shape::Path::HorizontalLineCommand

Public Class Methods

new(relative, preceding_command, x) click to toggle source
Calls superclass method DYI::Shape::Path::LineCommand::new
# File lib/dyi/shape/path.rb, line 756
def initialize(relative, preceding_command, x)
  super(relative, preceding_command, Coordinate.new(x, relative ? 0 : preceding_command.last_point.y))
end

Public Instance Methods

instructions_char() click to toggle source
# File lib/dyi/shape/path.rb, line 768
def instructions_char
  relative? ? 'h' : 'H'
end
to_compatible_commands(preceding_command) click to toggle source
# File lib/dyi/shape/path.rb, line 760
def to_compatible_commands(preceding_command)
  LineCommand.new(relative?, preceding_command, @point)
end
to_concise_syntax_fragments() click to toggle source
# File lib/dyi/shape/path.rb, line 764
def to_concise_syntax_fragments
  used_same_command? ? @point.x.to_s : (instructions_char + @point.x.to_s)
end