Class: Plist::PData

Inherits:
PTag
  • Object
show all
Defined in:
lib/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



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

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