Class: Oddb2xml::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/oddb2xml/builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBuilder

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

#indexObject

Returns the value of attribute index.



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

def index
  @index
end

#itemsObject

Returns the value of attribute items.



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

def items
  @items
end

#subjectObject

Returns the value of attribute subject.



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

def subject
  @subject
end

Instance Method Details

#to_xmlObject



16
17
18
19
20
# File 'lib/oddb2xml/builder.rb', line 16

def to_xml
  if @subject
    self.send('build_' + @subject)
  end
end