Class: Saxerator::Builder::HashElement
- Inherits:
-
Hash
- Object
- Hash
- Saxerator::Builder::HashElement
- Defined in:
- lib/saxerator/builder/hash_element.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name = nil, attributes = nil) ⇒ HashElement
constructor
A new instance of HashElement.
- #to_a ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(name = nil, attributes = nil) ⇒ HashElement
Returns a new instance of HashElement.
10 11 12 13 14 |
# File 'lib/saxerator/builder/hash_element.rb', line 10 def initialize(name = nil, attributes = nil) @name = name @attributes = attributes super({}) end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
7 8 9 |
# File 'lib/saxerator/builder/hash_element.rb', line 7 def attributes @attributes end |
#name ⇒ Object
Returns the value of attribute name.
8 9 10 |
# File 'lib/saxerator/builder/hash_element.rb', line 8 def name @name end |
Instance Method Details
#to_a ⇒ Object
16 17 18 |
# File 'lib/saxerator/builder/hash_element.rb', line 16 def to_a ArrayElement.new(super, name) end |
#to_h ⇒ Object
20 |
# File 'lib/saxerator/builder/hash_element.rb', line 20 def to_h; self end |