Class: EbayItem
- Inherits:
-
Object
- Object
- EbayItem
- Defined in:
- lib/ebay_ruby/ebay_item.rb
Instance Attribute Summary collapse
-
#item ⇒ Object
readonly
Returns the value of attribute item.
Instance Method Summary collapse
- #build_items_data ⇒ Object
-
#initialize(item) ⇒ EbayItem
constructor
A new instance of EbayItem.
Constructor Details
#initialize(item) ⇒ EbayItem
Returns a new instance of EbayItem.
3 4 5 |
# File 'lib/ebay_ruby/ebay_item.rb', line 3 def initialize(item) @item = item end |
Instance Attribute Details
#item ⇒ Object (readonly)
Returns the value of attribute item.
7 8 9 |
# File 'lib/ebay_ruby/ebay_item.rb', line 7 def item @item end |
Instance Method Details
#build_items_data ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/ebay_ruby/ebay_item.rb', line 9 def build_items_data item.keys.each do |attribute| = class << self; self; end .send(:define_method, "#{attribute}") do return item[attribute] end end end |