Class: Gcodify::Program
- Inherits:
-
Object
- Object
- Gcodify::Program
- Includes:
- OpsMixin
- Defined in:
- lib/gcodify/program.rb
Overview
Represents a GCode program. It contains a property @ops, which is an array of all the ops, in order, in the program.
Instance Attribute Summary collapse
-
#ops ⇒ Object
Access all ops in the program.
Instance Method Summary collapse
-
#initialize ⇒ Program
constructor
A new instance of Program.
-
#to_gcode ⇒ String
Converts the Program to a Gcode string.
Methods included from OpsMixin
#circular_pocket, #face, #gcode, #hole
Constructor Details
#initialize ⇒ Program
Returns a new instance of Program.
12 13 14 |
# File 'lib/gcodify/program.rb', line 12 def initialize @ops = [] end |
Instance Attribute Details
#ops ⇒ Object
Access all ops in the program
8 9 10 |
# File 'lib/gcodify/program.rb', line 8 def ops @ops end |
Instance Method Details
#to_gcode ⇒ String
Converts the Gcodify::Program to a Gcode string
19 20 21 22 23 24 25 26 |
# File 'lib/gcodify/program.rb', line 19 def to_gcode gcode = "" @ops.each do |op| # Append that Op's generated gcode to the full gcode string gcode << op.to_gcode end gcode # Return the generated gcode end |