Class: Oddb2xml::Builder

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Builder

Returns a new instance of Builder.



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/oddb2xml/builder.rb', line 25

def initialize(args = {})
  @options    = args
  @subject    = nil
  @index      = {}
  @items      = {}
  @flags      = {}
  @lppvs      = {}
  @infos      = {}
  @packs      = {}
  @migel      = {}
  @prices     = {} # zurrose
  @actions    = []
  @orphans    = []
  @fridges    = []
  @ean14      = false
  @companies  = []
  @people     = []
  @tag_suffix = nil
  if block_given?
    yield self
  end
end

Instance Attribute Details

#actionsObject

Returns the value of attribute actions.



20
21
22
# File 'lib/oddb2xml/builder.rb', line 20

def actions
  @actions
end

#companiesObject

Returns the value of attribute companies.



20
21
22
# File 'lib/oddb2xml/builder.rb', line 20

def companies
  @companies
end

#ean14Object

Returns the value of attribute ean14.



20
21
22
# File 'lib/oddb2xml/builder.rb', line 20

def ean14
  @ean14
end

#flagsObject

Returns the value of attribute flags.



20
21
22
# File 'lib/oddb2xml/builder.rb', line 20

def flags
  @flags
end

#fridgesObject

Returns the value of attribute fridges.



20
21
22
# File 'lib/oddb2xml/builder.rb', line 20

def fridges
  @fridges
end

#indexObject

Returns the value of attribute index.



20
21
22
# File 'lib/oddb2xml/builder.rb', line 20

def index
  @index
end

#infosObject

Returns the value of attribute infos.



20
21
22
# File 'lib/oddb2xml/builder.rb', line 20

def infos
  @infos
end

#itemsObject

Returns the value of attribute items.



20
21
22
# File 'lib/oddb2xml/builder.rb', line 20

def items
  @items
end

#lppvsObject

Returns the value of attribute lppvs.



20
21
22
# File 'lib/oddb2xml/builder.rb', line 20

def lppvs
  @lppvs
end

#migelObject

Returns the value of attribute migel.



20
21
22
# File 'lib/oddb2xml/builder.rb', line 20

def migel
  @migel
end

#orphansObject

Returns the value of attribute orphans.



20
21
22
# File 'lib/oddb2xml/builder.rb', line 20

def orphans
  @orphans
end

#packsObject

Returns the value of attribute packs.



20
21
22
# File 'lib/oddb2xml/builder.rb', line 20

def packs
  @packs
end

#peopleObject

Returns the value of attribute people.



20
21
22
# File 'lib/oddb2xml/builder.rb', line 20

def people
  @people
end

#pricesObject

Returns the value of attribute prices.



20
21
22
# File 'lib/oddb2xml/builder.rb', line 20

def prices
  @prices
end

#subjectObject

Returns the value of attribute subject.



20
21
22
# File 'lib/oddb2xml/builder.rb', line 20

def subject
  @subject
end

#tag_suffixObject

Returns the value of attribute tag_suffix.



20
21
22
# File 'lib/oddb2xml/builder.rb', line 20

def tag_suffix
  @tag_suffix
end

Instance Method Details

#to_dat(subject = nil) ⇒ Object



54
55
56
57
58
59
60
# File 'lib/oddb2xml/builder.rb', line 54

def to_dat(subject=nil)
  if subject
    self.send('build_' + subject.to_s)
  elsif @subject
    self.send('build_' + @subject.to_s)
  end
end

#to_xml(subject = nil) ⇒ Object



47
48
49
50
51
52
53
# File 'lib/oddb2xml/builder.rb', line 47

def to_xml(subject=nil)
  if subject
    self.send('build_' + subject.to_s)
  elsif @subject
    self.send('build_' + @subject.to_s)
  end
end