class STLgen::STL::Cube

Public Class Methods

new(attrs = {}) click to toggle source
Calls superclass method STLgen::STL::Base::new
# File lib/stlgen/stl/cube.rb, line 7
def initialize(attrs = {})
  @width = attrs[:width] || 1
  @length = attrs[:length] || 1
  @height = attrs[:height] || 1
  super(attrs)
end

Public Instance Methods

generate() click to toggle source
# File lib/stlgen/stl/cube.rb, line 14
def generate
  template_path = Pathname.new("lib/stlgen/ascii_templates/cube.erb")
  template = ERB.new(template_path.read)
  template.result(binding)
end