Class: Coneco::Product

Inherits:
Object
  • Object
show all
Includes:
InitHelper
Defined in:
lib/coneco/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from InitHelper

#_to_ivar_name, #populate

Constructor Details

#initialize(h) ⇒ Product

Returns a new instance of Product.



90
91
92
93
94
95
96
97
98
99
100
# File 'lib/coneco/client.rb', line 90

def initialize(h)
  populate(h)
  @top_category = Category.new(@top_category) if @top_category
  @middle_category = Category.new(@middle_category) if @middle_category
  @category = Category.new(@category) if @category
  @specifications.map! {|i| Specification.new(i) } if @specifications
  @cone_click = ConeClick.new(@cone_click) if @cone_click
  @review = ReviewItem.new(@review) if @review
  @user_review.map! {|i| ReviewItem.new(i) } if @user_review
  @avg_ratings = ReviewItem.new(@avg_ratings) if @avg_ratings
end

Instance Attribute Details

#average_priceObject

Returns the value of attribute average_price.



86
87
88
# File 'lib/coneco/client.rb', line 86

def average_price
  @average_price
end

#avg_ratingsObject

Returns the value of attribute avg_ratings.



86
87
88
# File 'lib/coneco/client.rb', line 86

def avg_ratings
  @avg_ratings
end

#brandObject

Returns the value of attribute brand.



86
87
88
# File 'lib/coneco/client.rb', line 86

def brand
  @brand
end

#categoryObject

Returns the value of attribute category.



86
87
88
# File 'lib/coneco/client.rb', line 86

def category
  @category
end

#com_idObject

Returns the value of attribute com_id.



86
87
88
# File 'lib/coneco/client.rb', line 86

def com_id
  @com_id
end

#cone_clickObject

Returns the value of attribute cone_click.



86
87
88
# File 'lib/coneco/client.rb', line 86

def cone_click
  @cone_click
end

#descriptionObject

Returns the value of attribute description.



86
87
88
# File 'lib/coneco/client.rb', line 86

def description
  @description
end

#highest_priceObject

Returns the value of attribute highest_price.



86
87
88
# File 'lib/coneco/client.rb', line 86

def highest_price
  @highest_price
end

#image_urlObject

Returns the value of attribute image_url.



86
87
88
# File 'lib/coneco/client.rb', line 86

def image_url
  @image_url
end

#lowest_priceObject

Returns the value of attribute lowest_price.



86
87
88
# File 'lib/coneco/client.rb', line 86

def lowest_price
  @lowest_price
end

#manufacturerObject

Returns the value of attribute manufacturer.



86
87
88
# File 'lib/coneco/client.rb', line 86

def manufacturer
  @manufacturer
end

#middle_categoryObject

Returns the value of attribute middle_category.



86
87
88
# File 'lib/coneco/client.rb', line 86

def middle_category
  @middle_category
end

#nameObject

Returns the value of attribute name.



86
87
88
# File 'lib/coneco/client.rb', line 86

def name
  @name
end

#rankingObject

Returns the value of attribute ranking.



86
87
88
# File 'lib/coneco/client.rb', line 86

def ranking
  @ranking
end

#release_dateObject

Returns the value of attribute release_date.



86
87
88
# File 'lib/coneco/client.rb', line 86

def release_date
  @release_date
end

#reviewObject

Returns the value of attribute review.



86
87
88
# File 'lib/coneco/client.rb', line 86

def review
  @review
end

#seller_countObject

Returns the value of attribute seller_count.



86
87
88
# File 'lib/coneco/client.rb', line 86

def seller_count
  @seller_count
end

#small_image_urlObject

Returns the value of attribute small_image_url.



86
87
88
# File 'lib/coneco/client.rb', line 86

def small_image_url
  @small_image_url
end

#specificationsObject

Returns the value of attribute specifications.



86
87
88
# File 'lib/coneco/client.rb', line 86

def specifications
  @specifications
end

#top_categoryObject

Returns the value of attribute top_category.



86
87
88
# File 'lib/coneco/client.rb', line 86

def top_category
  @top_category
end

#urlObject

Returns the value of attribute url.



86
87
88
# File 'lib/coneco/client.rb', line 86

def url
  @url
end

#user_reviewObject

Returns the value of attribute user_review.



86
87
88
# File 'lib/coneco/client.rb', line 86

def user_review
  @user_review
end