Class: DYI::Shape::Path::CloseCommand

Inherits:
CommandBase show all
Defined in:
lib/dyi/shape/path.rb

Overview

Since:

  • 0.0.0

Instance Attribute Summary

Attributes inherited from CommandBase

#point, #preceding_command

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CommandBase

absolute_commands, #preceding_point, relative_commands, #start_point, #to_compatible_commands, #used_same_command?

Constructor Details

#initialize(preceding_command) ⇒ CloseCommand

Returns a new instance of CloseCommand.

Raises:

  • (ArgumentError)

Since:

  • 0.0.0



695
696
697
698
699
700
# File 'lib/dyi/shape/path.rb', line 695

def initialize(preceding_command)
  raise ArgumentError, 'preceding_command is nil' if preceding_command.nil?
  @relative = nil
  @preceding_command = preceding_command
  @point = nil
end

Class Method Details

.commands(preceding_command) ⇒ Object

Since:

  • 0.0.0



725
726
727
# File 'lib/dyi/shape/path.rb', line 725

def commands(preceding_command)
  [new(preceding_command)]
end

Instance Method Details

#absolute?Boolean

Returns:

  • (Boolean)

Since:

  • 0.0.0



710
711
712
# File 'lib/dyi/shape/path.rb', line 710

def absolute?
  nil
end

#instructions_charObject

Since:

  • 0.0.0



718
719
720
# File 'lib/dyi/shape/path.rb', line 718

def instructions_char
  'Z'
end

#last_pointObject

Since:

  • 0.0.0



702
703
704
# File 'lib/dyi/shape/path.rb', line 702

def last_point
  start_point
end

#relative?Boolean

Returns:

  • (Boolean)

Since:

  • 0.0.0



706
707
708
# File 'lib/dyi/shape/path.rb', line 706

def relative?
  nil
end

#to_concise_syntax_fragmentsObject

Since:

  • 0.0.0



714
715
716
# File 'lib/dyi/shape/path.rb', line 714

def to_concise_syntax_fragments
  instructions_char
end