Class: Plist::Listener

### Home Classes Methods

### In Files

- lib/plist/parser.rb

### Parent

Object

### Methods

- ::new
- #tag_end
- #tag_start
- #text

### Class/Module Index

Quicksearch

- Plist
- Plist::Emit
- Plist::Listener
- Plist::PArray
- Plist::PData
- Plist::PDate
- Plist::PDict
- Plist::PFalse
- Plist::PInteger
- Plist::PKey
- Plist::PList
- Plist::PReal
- Plist::PString
- Plist::PTag
- Plist::PTrue
- Plist::StreamParser

No matching classes.

# 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 38
    def initialize
      @result = nil
      @open   = Array.new
    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

[Validate]

Generated with the Darkfish Rdoc Generator 2.