Class: NSWTopo::SVGFormatter

Inherits:
REXML::Formatters::Pretty
  • Object
show all
Defined in:
lib/nswtopo/formats/svg.rb

Instance Method Summary collapse

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