class Plist::Listener

Attributes

open[RW]

include REXML::StreamListener

result[RW]

include REXML::StreamListener

Public Class Methods

new() click to toggle source
# File lib/plist/parser.rb, line 39
def initialize
  @result = nil
  @open   = []
end

Public Instance Methods

tag_end(name) click to toggle source
# File lib/plist/parser.rb, line 52
def tag_end(name)
  last = @open.pop
  if @open.empty?
    @result = last.to_ruby
  else
    @open.last.children.push last
  end
end
tag_start(name, attributes) click to toggle source
# File lib/plist/parser.rb, line 44
def tag_start(name, attributes)
  @open.push PTag.mappings[name].new
end
text(contents) click to toggle source
# File lib/plist/parser.rb, line 48
def text(contents)
  @open.last.text = contents if @open.last
end