Class: SvgStack
- Inherits:
-
Object
- Object
- SvgStack
- Defined in:
- lib/svgstack.rb
Instance Method Summary collapse
-
#initialize(data = nil, x: 0, y: 0, width: 700, height: 70) ⇒ SvgStack
constructor
A new instance of SvgStack.
- #save(file = 'untitled') ⇒ Object
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 |