Class: Plist::PDict

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

Instance Attribute Summary

Attributes inherited from PTag

#children, #options, #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



181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# File 'lib/plist/parser.rb', line 181

def to_ruby
  dict = {}
  key = nil

  children.each do |c|
    if key.nil?
      key = c.to_ruby
    else
      dict[key] = c.to_ruby
      key = nil
    end
  end

  dict
end