Class: NSWTopo::SVGFormatter
- Inherits:
-
REXML::Formatters::Pretty
- Object
- REXML::Formatters::Pretty
- NSWTopo::SVGFormatter
- Defined in:
- lib/nswtopo/formats/svg.rb
Instance Method Summary collapse
-
#initialize(*args) ⇒ SVGFormatter
constructor
A new instance of SVGFormatter.
- #write_element(node, output) ⇒ Object
Constructor Details
#initialize(*args) ⇒ SVGFormatter
Returns a new instance of SVGFormatter.
3 4 5 6 |
# File 'lib/nswtopo/formats/svg.rb', line 3 def initialize(*args) super self.compact, @default = true, REXML::Formatters::Default.new end |
Instance Method Details
#write_element(node, output) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/nswtopo/formats/svg.rb', line 8 def write_element(node, output) case node.name when "text" output << ' ' * @level @default.write_element node, output else super end end |