Class: Saxerator::Builder::StringElement

Inherits:
String
  • Object
show all
Defined in:
lib/saxerator/builder/string_element.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(str, name, attributes) ⇒ StringElement

Returns a new instance of StringElement.



9
10
11
12
13
# File 'lib/saxerator/builder/string_element.rb', line 9

def initialize(str, name, attributes)
  self.name = name
  self.attributes = attributes
  super(str)
end

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



6
7
8
# File 'lib/saxerator/builder/string_element.rb', line 6

def attributes
  @attributes
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

Instance Method Details

#to_aObject



15
16
17
18
19
20
# File 'lib/saxerator/builder/string_element.rb', line 15

def to_a
  array = ArrayElement.new
  array << self
  array.name = name
  array
end