Class: Rpub::XmlFile

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeXmlFile

Returns a new instance of XmlFile.



6
7
8
# File 'lib/rpub/xml_file.rb', line 6

def initialize
  @xml = Builder::XmlMarkup.new :indent => 2
end

Instance Attribute Details

#xmlBuilder::XmlMarkup (readonly)

Returns:

  • (Builder::XmlMarkup)


4
5
6
# File 'lib/rpub/xml_file.rb', line 4

def xml
  @xml
end

Instance Method Details

#to_sString

Returns render this file and output as string.

Returns:

  • (String)

    render this file and output as string



11
12
13
14
# File 'lib/rpub/xml_file.rb', line 11

def to_s
  render
  xml.target!
end