Class: Pump::Xml::Node
- Inherits:
-
Object
- Object
- Pump::Xml::Node
- Defined in:
- lib/pump/xml/node.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#nodes ⇒ Object
readonly
Returns the value of attribute nodes.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(name, attributes = {}, nodes = [], options = {}) ⇒ Node
constructor
A new instance of Node.
- #level=(new_level) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name, attributes = {}, nodes = [], options = {}) ⇒ Node
Returns a new instance of Node.
6 7 8 9 10 11 12 |
# File 'lib/pump/xml/node.rb', line 6 def initialize(name, attributes={}, nodes=[], ={}) @name = name @attributes = attributes || {} @options = ( || {}).dup @nodes = [] Array(nodes).each{|node| add_node(node) } end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
4 5 6 |
# File 'lib/pump/xml/node.rb', line 4 def attributes @attributes end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/pump/xml/node.rb', line 4 def name @name end |
#nodes ⇒ Object (readonly)
Returns the value of attribute nodes.
4 5 6 |
# File 'lib/pump/xml/node.rb', line 4 def nodes @nodes end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/pump/xml/node.rb', line 4 def @options end |