Class: STLgen::STL::Cube
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(attrs = {}) ⇒ Cube
constructor
A new instance of Cube.
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
#generate ⇒ Object
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 |