Class: Xolphin::Api::Responses::Product

Inherits:
Base
  • Object
show all
Defined in:
lib/xolphin/api/responses/product.rb

Instance Method Summary collapse

Methods inherited from Base

#_embedded, #error?, #errors, #limit, #message, #page, #pages, #total

Constructor Details

#initialize(data) ⇒ Product

Returns a new instance of Product.



5
6
7
# File 'lib/xolphin/api/responses/product.rb', line 5

def initialize(data)
  super(data)
end

Instance Method Details

#brandObject



27
28
29
# File 'lib/xolphin/api/responses/product.rb', line 27

def brand
  @data["brand"]
end

#idObject



23
24
25
# File 'lib/xolphin/api/responses/product.rb', line 23

def id
  @data["id"]
end

#included_domainsObject



43
44
45
# File 'lib/xolphin/api/responses/product.rb', line 43

def included_domains
  @data["includedDomains"]
end

#max_domainsObject



47
48
49
# File 'lib/xolphin/api/responses/product.rb', line 47

def max_domains
  @data["maxDomains"]
end

#nameObject



31
32
33
# File 'lib/xolphin/api/responses/product.rb', line 31

def name
  @data["name"]
end

#pricesObject



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/xolphin/api/responses/product.rb', line 9

def prices
  @prices ||= begin
    prices = []

    if @data["prices"]
      @data["prices"].each do |price|
        prices << ProductPrice.new(price)
      end
    end

    prices
  end
end

#typeObject



35
36
37
# File 'lib/xolphin/api/responses/product.rb', line 35

def type
  @data["type"]
end

#validationObject



39
40
41
# File 'lib/xolphin/api/responses/product.rb', line 39

def validation
  @data["validation"]
end