Class: Oddb2xml::Builder
- Inherits:
-
Object
- Object
- Oddb2xml::Builder
- Defined in:
- lib/oddb2xml/builder.rb
Instance Attribute Summary collapse
-
#actions ⇒ Object
Returns the value of attribute actions.
-
#companies ⇒ Object
Returns the value of attribute companies.
-
#ean14 ⇒ Object
Returns the value of attribute ean14.
-
#flags ⇒ Object
Returns the value of attribute flags.
-
#fridges ⇒ Object
Returns the value of attribute fridges.
-
#index ⇒ Object
Returns the value of attribute index.
-
#infos ⇒ Object
Returns the value of attribute infos.
-
#items ⇒ Object
Returns the value of attribute items.
-
#lppvs ⇒ Object
Returns the value of attribute lppvs.
-
#migel ⇒ Object
Returns the value of attribute migel.
-
#orphans ⇒ Object
Returns the value of attribute orphans.
-
#packs ⇒ Object
Returns the value of attribute packs.
-
#people ⇒ Object
Returns the value of attribute people.
-
#prices ⇒ Object
Returns the value of attribute prices.
-
#subject ⇒ Object
Returns the value of attribute subject.
-
#tag_suffix ⇒ Object
Returns the value of attribute tag_suffix.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Builder
constructor
A new instance of Builder.
- #to_dat(subject = nil) ⇒ Object
- #to_xml(subject = nil) ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Builder
Returns a new instance of Builder.
24 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 24 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 @pharmacode = {} # index pharmacode => item if block_given? yield self end end |
Instance Attribute Details
#actions ⇒ Object
Returns the value of attribute actions.
19 20 21 |
# File 'lib/oddb2xml/builder.rb', line 19 def actions @actions end |
#companies ⇒ Object
Returns the value of attribute companies.
19 20 21 |
# File 'lib/oddb2xml/builder.rb', line 19 def companies @companies end |
#ean14 ⇒ Object
Returns the value of attribute ean14.
19 20 21 |
# File 'lib/oddb2xml/builder.rb', line 19 def ean14 @ean14 end |
#flags ⇒ Object
Returns the value of attribute flags.
19 20 21 |
# File 'lib/oddb2xml/builder.rb', line 19 def flags @flags end |
#fridges ⇒ Object
Returns the value of attribute fridges.
19 20 21 |
# File 'lib/oddb2xml/builder.rb', line 19 def fridges @fridges end |
#index ⇒ Object
Returns the value of attribute index.
19 20 21 |
# File 'lib/oddb2xml/builder.rb', line 19 def index @index end |
#infos ⇒ Object
Returns the value of attribute infos.
19 20 21 |
# File 'lib/oddb2xml/builder.rb', line 19 def infos @infos end |
#items ⇒ Object
Returns the value of attribute items.
19 20 21 |
# File 'lib/oddb2xml/builder.rb', line 19 def items @items end |
#lppvs ⇒ Object
Returns the value of attribute lppvs.
19 20 21 |
# File 'lib/oddb2xml/builder.rb', line 19 def lppvs @lppvs end |
#migel ⇒ Object
Returns the value of attribute migel.
19 20 21 |
# File 'lib/oddb2xml/builder.rb', line 19 def migel @migel end |
#orphans ⇒ Object
Returns the value of attribute orphans.
19 20 21 |
# File 'lib/oddb2xml/builder.rb', line 19 def orphans @orphans end |
#packs ⇒ Object
Returns the value of attribute packs.
19 20 21 |
# File 'lib/oddb2xml/builder.rb', line 19 def packs @packs end |
#people ⇒ Object
Returns the value of attribute people.
19 20 21 |
# File 'lib/oddb2xml/builder.rb', line 19 def people @people end |
#prices ⇒ Object
Returns the value of attribute prices.
19 20 21 |
# File 'lib/oddb2xml/builder.rb', line 19 def prices @prices end |
#subject ⇒ Object
Returns the value of attribute subject.
19 20 21 |
# File 'lib/oddb2xml/builder.rb', line 19 def subject @subject end |
#tag_suffix ⇒ Object
Returns the value of attribute tag_suffix.
19 20 21 |
# File 'lib/oddb2xml/builder.rb', line 19 def tag_suffix @tag_suffix end |
Instance Method Details
#to_dat(subject = nil) ⇒ Object
55 56 57 58 59 60 61 62 |
# File 'lib/oddb2xml/builder.rb', line 55 def to_dat(subject=nil) Oddb2xml.log "to_dat subject #{subject ? subject.to_s : @subject.to_s} for #{self.class}" 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 54 |
# File 'lib/oddb2xml/builder.rb', line 47 def to_xml(subject=nil) Oddb2xml.log "to_xml subject #{subject ? subject.to_s : @subject.to_s} for #{self.class}" if subject self.send('build_' + subject.to_s) elsif @subject self.send('build_' + @subject.to_s) end end |