Class: BoxGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/box_generator.rb,
lib/box_generator/version.rb

Constant Summary collapse

VERSION =
"0.1.0"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(settings = {}) ⇒ BoxGenerator

Returns a new instance of BoxGenerator.



7
8
9
# File 'lib/box_generator.rb', line 7

def initialize(settings = {})
  self.settings = settings
end

Instance Attribute Details

#settingsObject

Returns the value of attribute settings.



5
6
7
# File 'lib/box_generator.rb', line 5

def settings
  @settings
end

Instance Method Details

#to_scadObject



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/box_generator.rb', line 11

def to_scad
  <<-SCAD
#{comments}

#{header}

difference() {
#{main_cube}
#{compartiments}
#{magnets if magnets?}
}
  SCAD
end