Class: Plist::PData

Inherits:
PTag
  • Object
show all
Defined in:
lib/facter/util/plist/parser.rb

Instance Attribute Summary

Attributes inherited from PTag

#children, #text

Instance Method Summary collapse

Methods inherited from PTag

inherited, #initialize, mappings

Constructor Details

This class inherits a constructor from Plist::PTag

Instance Method Details

#to_rubyObject



211
212
213
214
215
216
217
218
219
220
221
222
# File 'lib/facter/util/plist/parser.rb', line 211

def to_ruby
  data = Base64.decode64(text.gsub(/\s+/, ''))

  begin
    return Marshal.load(data)
  rescue Exception => e
    io = StringIO.new
    io.write data
    io.rewind
    return io
  end
end