Method: Plist::Emit.dump

Defined in:
lib/plist/generator.rb

.dump(obj, envelope = true, options = {}) ⇒ Object

The following Ruby classes are converted into native plist types:

Array, Bignum, Date, DateTime, Fixnum, Float, Hash, Integer, String, Symbol, Time

Write us (via RubyForge) if you think another class can be coerced safely into one of the expected plist classes.

IO and StringIO objects are encoded and placed in <data> elements; other objects are Marshal.dump‘ed unless they implement to_plist_node.

The envelope parameters dictates whether or not the resultant plist fragment is wrapped in the normal XML/plist header and footer. Set it to false if you only want the fragment.



45
46
47
48
49
50
51
52
# File 'lib/plist/generator.rb', line 45

def self.dump(obj, envelope = true, options = {})
  options = { :indent => DEFAULT_INDENT }.merge(options)

  output = PlistBuilder.new(options[:indent]).build(obj)
  output = wrap(output) if envelope

  output
end