Class: AboutYou::SDK::Model::PriceRange

Inherits:
Object
  • Object
show all
Defined in:
lib/AboutYou/Model/ProductSearchResult/price_range.rb

Overview

This class represents a Price Range model.

author

Collins GmbH & Co KG

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#fromObject

startpoint of the price range



13
14
15
# File 'lib/AboutYou/Model/ProductSearchResult/price_range.rb', line 13

def from
  @from
end

#maxObject

max value of the price range



19
20
21
# File 'lib/AboutYou/Model/ProductSearchResult/price_range.rb', line 19

def max
  @max
end

#meanObject

mean



21
22
23
# File 'lib/AboutYou/Model/ProductSearchResult/price_range.rb', line 21

def mean
  @mean
end

#minObject

min value of the price range



17
18
19
# File 'lib/AboutYou/Model/ProductSearchResult/price_range.rb', line 17

def min
  @min
end

#product_countObject

the product count



11
12
13
# File 'lib/AboutYou/Model/ProductSearchResult/price_range.rb', line 11

def product_count
  @product_count
end

#sumObject

sum



23
24
25
# File 'lib/AboutYou/Model/ProductSearchResult/price_range.rb', line 23

def sum
  @sum
end

#toObject

end of the price range



15
16
17
# File 'lib/AboutYou/Model/ProductSearchResult/price_range.rb', line 15

def to
  @to
end

Class Method Details

.create_from_json(json_object) ⇒ Object

This method is used for creating an instance of this class by a json_object.

  • Args :

    • json_object -> the jsonObject received from the api

  • Returns :

    • Instance of AboutYou::SDK::Model::PriceRange



34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/AboutYou/Model/ProductSearchResult/price_range.rb', line 34

def self.create_from_json(json_object)
  price_range = new

  price_range.product_count = json_object['count']
  price_range.from = json_object['from']
  price_range.to = json_object['to']
  price_range.min = json_object['min']
  price_range.max = json_object['max']
  price_range.mean = json_object['mean']
  price_range.sum = json_object['total']

  price_range
end