Class: Oddb2xml::Builder
- Inherits:
-
Object
- Object
- Oddb2xml::Builder
- Defined in:
- lib/oddb2xml/builder.rb
Instance Attribute Summary collapse
-
#index ⇒ Object
Returns the value of attribute index.
-
#items ⇒ Object
Returns the value of attribute items.
-
#subject ⇒ Object
Returns the value of attribute subject.
Instance Method Summary collapse
-
#initialize ⇒ Builder
constructor
A new instance of Builder.
- #to_xml ⇒ Object
Constructor Details
#initialize ⇒ Builder
Returns a new instance of Builder.
8 9 10 11 12 13 14 15 |
# File 'lib/oddb2xml/builder.rb', line 8 def initialize @subject = nil @index = {} @items = {} if block_given? yield self end end |
Instance Attribute Details
#index ⇒ Object
Returns the value of attribute index.
7 8 9 |
# File 'lib/oddb2xml/builder.rb', line 7 def index @index end |
#items ⇒ Object
Returns the value of attribute items.
7 8 9 |
# File 'lib/oddb2xml/builder.rb', line 7 def items @items end |
#subject ⇒ Object
Returns the value of attribute subject.
7 8 9 |
# File 'lib/oddb2xml/builder.rb', line 7 def subject @subject end |
Instance Method Details
#to_xml ⇒ Object
16 17 18 19 20 |
# File 'lib/oddb2xml/builder.rb', line 16 def to_xml if @subject self.send('build_' + @subject) end end |