Class: STLgen::STL::Cube

Inherits:
Base
  • Object
show all
Defined in:
lib/stlgen/stl/cube.rb

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Cube

Returns a new instance of Cube.



7
8
9
10
11
12
# 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

Instance Method Details

#generateObject



14
15
16
17
18
# 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