Parent

Methods

Class/Module Index [+]

Quicksearch

Ruote::XmlParser::Node

A helper class to store the temporary tree while it gets parsed.

Attributes

attributes[R]
children[R]
parent[R]

Public Class Methods

new(parent, name, attributes) click to toggle source
# File lib/ruote/parser/xml.rb, line 43
def initialize (parent, name, attributes)

  @parent = parent
  @name = name
  @attributes = attributes.inject({}) { |h, (k, v)|
    h[k.gsub(/-/, '_')] = v
    h
  }
  @children = []

  parent.children << self if parent
end

Public Instance Methods

to_a() click to toggle source
# File lib/ruote/parser/xml.rb, line 56
def to_a
  [ @name, @attributes, @children.collect { |c| c.to_a } ]
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.