Class: GCoder::GCode::Command
Direct Known Subclasses
CannedCommand, CategoryCommand, Comment, CompensationCommand, CoordinateCommand, MCodeCommand, MotionCommand, OtherCommand
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Instance Method Summary collapse
-
#initialize(code, args) ⇒ Command
constructor
A new instance of Command.
- #to_s ⇒ Object
Constructor Details
#initialize(code, args) ⇒ Command
Returns a new instance of Command.
104 105 106 107 |
# File 'lib/gcoder/gcode.rb', line 104 def initialize(code, args) @code = code @args = args end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
102 103 104 |
# File 'lib/gcoder/gcode.rb', line 102 def args @args end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
102 103 104 |
# File 'lib/gcoder/gcode.rb', line 102 def code @code end |
Instance Method Details
#to_s ⇒ Object
109 110 111 |
# File 'lib/gcoder/gcode.rb', line 109 def to_s ( [code] + args.map {|e| e.join } ).join(" ") end |