Class: Ebisu::Item

Inherits:
Object
  • Object
show all
Defined in:
lib/ebisu/models/item.rb

Defined Under Namespace

Classes: Availability

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hit) ⇒ Item

Returns a new instance of Item.

Parameters:

  • hit (Hash)


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_rateObject

Returns the value of attribute affiliate_rate.



91
92
93
# File 'lib/ebisu/models/item.rb', line 91

def affiliate_rate
  @affiliate_rate
end

#availabilityObject (readonly)

Returns the value of attribute availability.



23
24
25
# File 'lib/ebisu/models/item.rb', line 23

def availability
  @availability
end

#brandsObject

Returns the value of attribute brands.



83
84
85
# File 'lib/ebisu/models/item.rb', line 83

def brands
  @brands
end

#categoryObject

Returns the value of attribute category.



75
76
77
# File 'lib/ebisu/models/item.rb', line 75

def category
  @category
end

#category_id_pathObject

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

#codeObject

Returns the value of attribute code.



27
28
29
# File 'lib/ebisu/models/item.rb', line 27

def code
  @code
end

#descriptionObject

Returns the value of attribute description.



11
12
13
# File 'lib/ebisu/models/item.rb', line 11

def description
  @description
end

#ex_imageObject

Returns the value of attribute ex_image.



59
60
61
# File 'lib/ebisu/models/item.rb', line 59

def ex_image
  @ex_image
end

#headlineObject

Returns the value of attribute headline.



15
16
17
# File 'lib/ebisu/models/item.rb', line 15

def headline
  @headline
end

#imageObject

Returns the value of attribute image.



31
32
33
# File 'lib/ebisu/models/item.rb', line 31

def image
  @image
end

#isbn_codeObject

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_codeObject

Returns the value of attribute jan_code.



43
44
45
# File 'lib/ebisu/models/item.rb', line 43

def jan_code
  @jan_code
end

#modelObject

Returns the value of attribute model.



47
48
49
# File 'lib/ebisu/models/item.rb', line 47

def model
  @model
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/ebisu/models/item.rb', line 7

def name
  @name
end

#pointObject

Returns the value of attribute point.



67
68
69
# File 'lib/ebisu/models/item.rb', line 67

def point
  @point
end

#priceObject

Returns the value of attribute price.



35
36
37
# File 'lib/ebisu/models/item.rb', line 35

def price
  @price
end

#price_labelObject

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_dateObject

Returns the value of attribute release_date.



55
56
57
# File 'lib/ebisu/models/item.rb', line 55

def release_date
  @release_date
end

#reviewObject

Returns the value of attribute review.



63
64
65
# File 'lib/ebisu/models/item.rb', line 63

def review
  @review
end

#shippingObject

Returns the value of attribute shipping.



71
72
73
# File 'lib/ebisu/models/item.rb', line 71

def shipping
  @shipping
end

#storeObject

Returns the value of attribute store.



87
88
89
# File 'lib/ebisu/models/item.rb', line 87

def store
  @store
end

#urlObject

Returns the value of attribute url.



19
20
21
# File 'lib/ebisu/models/item.rb', line 19

def url
  @url
end