Module: Gcodify

Defined in:
lib/gcodify.rb,
lib/gcodify/op.rb,
lib/gcodify/program.rb,
lib/gcodify/version.rb

Overview

Gcodify is the main module that contains all the code. The only thing you'll be interacting with directly when you use it as a DSL is the module method #program, which is passed a block as a DSL.

Examples:

Using #program for a DSL

aProgram = Gcodify.program do
  # some code here
end

Defined Under Namespace

Modules: Ops, OpsMixin Classes: Op, Program

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.program(&block) ⇒ Program

Takes a block of operations and creates a new Program from them.

Examples:

Using it to create a Program

Gcodify.program do
  hole :at=>[0, 0], :depth=>0.25
end

Parameters:

  • block (Block)

    a block of operations (see Ops).

Returns:

  • (Program)

    a program created from `&block`


27
28
29
30
31
# File 'lib/gcodify.rb', line 27

def self.program(&block)
  prog = Program.new
  prog.instance_eval(&block)
  prog
end