Class: SketchUp::Builder
- Inherits:
-
Object
- Object
- SketchUp::Builder
- Defined in:
- lib/sketchup.rb
Instance Attribute Summary collapse
-
#container ⇒ Object
Returns the value of attribute container.
Instance Method Summary collapse
-
#initialize(container = nil) ⇒ Builder
constructor
Initialize with a Sketch or a Model.
- #to_a ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(container = nil) ⇒ Builder
Initialize with a Sketch or a Model
28 29 30 31 |
# File 'lib/sketchup.rb', line 28 def initialize(container=nil) @container = container @definition_names = {} end |
Instance Attribute Details
#container ⇒ Object
Returns the value of attribute container.
25 26 27 |
# File 'lib/sketchup.rb', line 25 def container @container end |
Instance Method Details
#to_a ⇒ Object
33 34 35 36 |
# File 'lib/sketchup.rb', line 33 def to_a a = to_array(@container) || [] # Generates the definitions as a side effect HEADER_LINES + @definition_names.values.flatten + a end |
#to_s ⇒ Object
38 39 40 |
# File 'lib/sketchup.rb', line 38 def to_s to_a.join("\n") << "\n" end |