Sha256: 3986c68bea5a801860b1483eee5843c8f0170e452ef42f1f6a5e6bd78500f721

Contents?: true

Size: 395 Bytes

Versions: 35

Compression:

Stored size: 395 Bytes

Contents

module XmlFormatter
  def to_xml(options = {})
    options[:indent] ||= 2
    xml = options[:builder] ||= Builder::XmlMarkup.new(:indent => options[:indent])
    xml.instruct! unless options[:skip_instruct]
    xml.tag!(self.class.name.downcase.to_sym, self.attributes) do
      self.class.reflect_on_all_associations.to_a.each do |assoc|
        xml.tag!(assoc.name)
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 4 rubygems

Version Path
breakpointer-surveyor-0.2.0 lib/xml_formatter.rb
ccls-surveyor-1.0.0 lib/xml_formatter.rb
jakewendt-surveyor-0.11.3 lib/xml_formatter.rb
surveyor-0.14.3 lib/xml_formatter.rb
surveyor-0.14.2 lib/xml_formatter.rb
surveyor-0.14.1 lib/xml_formatter.rb
surveyor-0.14.0 lib/xml_formatter.rb
surveyor-0.13.0 lib/xml_formatter.rb
surveyor-0.12.1 lib/xml_formatter.rb
surveyor-0.11.0 lib/xml_formatter.rb
surveyor-0.10.0 lib/xml_formatter.rb
surveyor-0.9.10 lib/xml_formatter.rb
surveyor-0.9.9 lib/xml_formatter.rb
surveyor-0.9.8 lib/xml_formatter.rb
surveyor-0.9.7 lib/xml_formatter.rb
surveyor-0.9.6 lib/xml_formatter.rb
surveyor-0.9.5 lib/xml_formatter.rb
surveyor-0.9.4 lib/xml_formatter.rb
surveyor-0.9.3 lib/xml_formatter.rb
surveyor-0.9.2 lib/xml_formatter.rb