Class: Plistr::Dict

Inherits:
Struct show all
Defined in:
lib/plistr.rb

Instance Method Summary collapse

Constructor Details

#initializeDict

Returns a new instance of Dict.



108
109
110
# File 'lib/plistr.rb', line 108

def initialize
  @hash = {}
end

Instance Method Details

#parseObject



112
113
114
# File 'lib/plistr.rb', line 112

def parse
  @hash
end

#push(value) ⇒ Object



116
117
118
119
120
121
122
123
# File 'lib/plistr.rb', line 116

def push(value)
  if !@key
    @key = value.text
  else
    @hash[@key] = value.parse
    @key = nil
  end
end