Class: SVGCreator
- Inherits:
-
Object
- Object
- SVGCreator
- Defined in:
- lib/teaching_printables/svg/svg_creator.rb
Instance Method Summary collapse
-
#initialize(width, height) ⇒ SVGCreator
constructor
Use SVGCreator to add svg components to an array Method ‘svg’ concatenates the array elements, adds header and footer, and returns svg string.
- #svg ⇒ Object
Constructor Details
#initialize(width, height) ⇒ SVGCreator
Use SVGCreator to add svg components to an array Method ‘svg’ concatenates the array elements, adds header and footer, and returns svg string
7 8 9 10 11 |
# File 'lib/teaching_printables/svg/svg_creator.rb', line 7 def initialize(width,height) @width = width @height = height @components = [] end |
Instance Method Details
#svg ⇒ Object
13 14 15 16 17 |
# File 'lib/teaching_printables/svg/svg_creator.rb', line 13 def svg @components.insert(0,SVGComponents::header(@width,@height)) @components << SVGComponents:: return @components.join end |