Class: Mosaiq::Svg
- Inherits:
-
Object
- Object
- Mosaiq::Svg
- Defined in:
- lib/mosaiq/svg.rb
Overview
Generate SVG version of the Mosaiq
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(canvas) ⇒ Svg
constructor
A new instance of Svg.
Constructor Details
#initialize(canvas) ⇒ Svg
Returns a new instance of Svg.
6 7 8 9 10 |
# File 'lib/mosaiq/svg.rb', line 6 def initialize(canvas) @canvas = canvas @width = canvas[0].count @height = canvas.count end |
Instance Method Details
#generate ⇒ Object
12 13 14 |
# File 'lib/mosaiq/svg.rb', line 12 def generate %(#{svg_header} #{svg_body}).tr("\n", '').gsub(/ +/, ' ') end |