Class: Ebisu::Item
- Inherits:
-
Object
- Object
- Ebisu::Item
- Defined in:
- lib/ebisu/models/item.rb
Defined Under Namespace
Classes: Availability
Instance Attribute Summary collapse
-
#affiliate_rate ⇒ Object
Returns the value of attribute affiliate_rate.
-
#availability ⇒ Object
readonly
Returns the value of attribute availability.
-
#brands ⇒ Object
Returns the value of attribute brands.
-
#category ⇒ Object
Returns the value of attribute category.
-
#category_id_path ⇒ Object
Returns the value of attribute category_id_path.
-
#code ⇒ Object
Returns the value of attribute code.
-
#description ⇒ Object
Returns the value of attribute description.
-
#ex_image ⇒ Object
Returns the value of attribute ex_image.
-
#headline ⇒ Object
Returns the value of attribute headline.
-
#image ⇒ Object
Returns the value of attribute image.
-
#isbn_code ⇒ Object
Returns the value of attribute isbn_code.
-
#jan_code ⇒ Object
Returns the value of attribute jan_code.
-
#model ⇒ Object
Returns the value of attribute model.
-
#name ⇒ Object
Returns the value of attribute name.
-
#point ⇒ Object
Returns the value of attribute point.
-
#price ⇒ Object
Returns the value of attribute price.
-
#price_label ⇒ Object
Returns the value of attribute price_label.
-
#release_date ⇒ Object
Returns the value of attribute release_date.
-
#review ⇒ Object
Returns the value of attribute review.
-
#shipping ⇒ Object
Returns the value of attribute shipping.
-
#store ⇒ Object
Returns the value of attribute store.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(hit) ⇒ Item
constructor
A new instance of Item.
Constructor Details
#initialize(hit) ⇒ Item
Returns a new instance of Item.
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/ebisu/models/item.rb', line 105 def initialize(hit) @name = hit.dig('name') @description = hit.dig('description') @headline = hit.dig('headLine') @url = hit.dig('url') @availability = Availability.new(hit.dig('inStock')) @code = hit.dig('code') @price = Ebisu::Price.new(hit.dig('price')) @price_label = Ebisu::PriceLabel.new(hit.dig('priceLabel')) @jan_code = hit.dig('janCode') @model = hit.dig('model') @isbn_code = hit.dig('isbnCode') @release_date = hit.dig('releaseDate') @image = Ebisu::Image.new(hit.dig('imageId'), hit.dig('image')) @ex_image = Ebisu::ExImage.new(hit.dig('exImage')) if hit.dig('exImage') @review = Ebisu::Review.new(hit.dig('review')) @affiliate_rate = hit.dig('affiliateRate') @point = Ebisu::Point.new(hit.dig('point')) @shipping = Ebisu::Shipping.new(hit.dig('shipping')) @category = Ebisu::YCategory.new(hit.dig('genreCategory')) @category_id_path = Ebisu::CategoryIdPath.new(hit.dig('parentGenreCategories')) @brands = Ebisu::Brands.new(hit.dig('brand')) @store = Ebisu::Store.new(hit.dig('seller')) end |
Instance Attribute Details
#affiliate_rate ⇒ Object
Returns the value of attribute affiliate_rate.
91 92 93 |
# File 'lib/ebisu/models/item.rb', line 91 def affiliate_rate @affiliate_rate end |
#availability ⇒ Object (readonly)
Returns the value of attribute availability.
23 24 25 |
# File 'lib/ebisu/models/item.rb', line 23 def availability @availability end |
#brands ⇒ Object
Returns the value of attribute brands.
83 84 85 |
# File 'lib/ebisu/models/item.rb', line 83 def brands @brands end |
#category ⇒ Object
Returns the value of attribute category.
75 76 77 |
# File 'lib/ebisu/models/item.rb', line 75 def category @category end |
#category_id_path ⇒ Object
Returns the value of attribute category_id_path.
79 80 81 |
# File 'lib/ebisu/models/item.rb', line 79 def category_id_path @category_id_path end |
#code ⇒ Object
Returns the value of attribute code.
27 28 29 |
# File 'lib/ebisu/models/item.rb', line 27 def code @code end |
#description ⇒ Object
Returns the value of attribute description.
11 12 13 |
# File 'lib/ebisu/models/item.rb', line 11 def description @description end |
#ex_image ⇒ Object
Returns the value of attribute ex_image.
59 60 61 |
# File 'lib/ebisu/models/item.rb', line 59 def ex_image @ex_image end |
#headline ⇒ Object
Returns the value of attribute headline.
15 16 17 |
# File 'lib/ebisu/models/item.rb', line 15 def headline @headline end |
#image ⇒ Object
Returns the value of attribute image.
31 32 33 |
# File 'lib/ebisu/models/item.rb', line 31 def image @image end |
#isbn_code ⇒ Object
Returns the value of attribute isbn_code.
51 52 53 |
# File 'lib/ebisu/models/item.rb', line 51 def isbn_code @isbn_code end |
#jan_code ⇒ Object
Returns the value of attribute jan_code.
43 44 45 |
# File 'lib/ebisu/models/item.rb', line 43 def jan_code @jan_code end |
#model ⇒ Object
Returns the value of attribute model.
47 48 49 |
# File 'lib/ebisu/models/item.rb', line 47 def model @model end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/ebisu/models/item.rb', line 7 def name @name end |
#point ⇒ Object
Returns the value of attribute point.
67 68 69 |
# File 'lib/ebisu/models/item.rb', line 67 def point @point end |
#price ⇒ Object
Returns the value of attribute price.
35 36 37 |
# File 'lib/ebisu/models/item.rb', line 35 def price @price end |
#price_label ⇒ Object
Returns the value of attribute price_label.
39 40 41 |
# File 'lib/ebisu/models/item.rb', line 39 def price_label @price_label end |
#release_date ⇒ Object
Returns the value of attribute release_date.
55 56 57 |
# File 'lib/ebisu/models/item.rb', line 55 def release_date @release_date end |
#review ⇒ Object
Returns the value of attribute review.
63 64 65 |
# File 'lib/ebisu/models/item.rb', line 63 def review @review end |
#shipping ⇒ Object
Returns the value of attribute shipping.
71 72 73 |
# File 'lib/ebisu/models/item.rb', line 71 def shipping @shipping end |
#store ⇒ Object
Returns the value of attribute store.
87 88 89 |
# File 'lib/ebisu/models/item.rb', line 87 def store @store end |
#url ⇒ Object
Returns the value of attribute url.
19 20 21 |
# File 'lib/ebisu/models/item.rb', line 19 def url @url end |