Class: Saxerator::Builder::HashElement

Inherits:
Hash
  • Object
show all
Defined in:
lib/saxerator/builder/hash_element.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#attributesObject

Returns the value of attribute attributes.



7
8
9
# File 'lib/saxerator/builder/hash_element.rb', line 7

def attributes
  @attributes
end

#nameObject

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_aObject



16
17
18
# File 'lib/saxerator/builder/hash_element.rb', line 16

def to_a
  ArrayElement.new(super, name)
end

#to_hObject



20
# File 'lib/saxerator/builder/hash_element.rb', line 20

def to_h; self end