Sha256: ac2b4676e9c43f1420a3687cc033ab44ca70fa84c143be55e84b0732669ec434
Contents?: true
Size: 515 Bytes
Versions: 2
Compression:
Stored size: 515 Bytes
Contents
class YaspTree def initialize(block) @head = Command.new(nil, []) process(block) end def tree @head end def add(obj) @head << obj end def to_scad @head.to_scad(0); end def process(block) instance_eval(&block) end def assign(&block) YaspTree.new(block).tree end def method_missing(m, *args, &block) element = Command.new(m, args) add(element) if block_given? previous_head = @head @head = element self.instance_eval(&block) @head = previous_head end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
yasp-2.0.2 | lib/YASP/yasp_tree.rb |
yasp-2.0.0 | lib/YASP/yasp_tree.rb |