Class: SvgStack

Inherits:
Object
  • Object
show all
Defined in:
lib/svgstack.rb

Instance Method Summary collapse

Constructor Details

#initialize(data = nil, x: 0, y: 0, width: 700, height: 70) ⇒ SvgStack



26
27
28
29
30
31
32
33
# File 'lib/svgstack.rb', line 26

def initialize(data=nil, x: 0,  y: 0, width: 700, height: 70)

  boxes = data if data.is_a? Array

  @svg = Victor::SVG.new viewBox: [x, y, width, height].join(' ')
  build boxes

end

Instance Method Details

#save(file = 'untitled') ⇒ Object



35
36
37
# File 'lib/svgstack.rb', line 35

def save(file='untitled')
  @svg.save file
end