Class: AgridClient::Quote

Inherits:
Object
  • Object
show all
Includes:
SwaggerModel
Defined in:
lib/agrid_client/models/quote.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SwaggerModel

#_deserialize, #_to_hash, #build_from_hash, #eql?, #to_body, #to_hash

Constructor Details

#initialize(attributes = {}) ⇒ Quote

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/agrid_client/models/quote.rb', line 78

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}

  if attributes[:'id']
    self.id = attributes[:'id']
  end
  if attributes[:'title']
    self.title = attributes[:'title']
  end
  if attributes[:'price']
    self.price = attributes[:'price']
  end
  if attributes[:'images']
    if (value = attributes[:'images']).is_a?(Array)
      self.images = value
    end
  end
  if attributes[:'company']
    self.company = attributes[:'company']
  end
  if attributes[:'service']
    self.service = attributes[:'service']
  end
  if attributes[:'categories']
    if (value = attributes[:'categories']).is_a?(Array)
      self.categories = value
    end
  end
  if attributes[:'filters']
    if (value = attributes[:'filters']).is_a?(Array)
      self.filters = value
    end
  end
end

Instance Attribute Details

#active_saleObject

Returns the value of attribute active_sale.



44
45
46
# File 'lib/agrid_client/models/quote.rb', line 44

def active_sale
  @active_sale
end

#categoriesObject

Items included on this quote



39
40
41
# File 'lib/agrid_client/models/quote.rb', line 39

def categories
  @categories
end

#companyObject

Company that offers this quote



33
34
35
# File 'lib/agrid_client/models/quote.rb', line 33

def company
  @company
end

#filtersObject

Goodsfor used to filter quotes



42
43
44
# File 'lib/agrid_client/models/quote.rb', line 42

def filters
  @filters
end

#idObject

Unique Id



21
22
23
# File 'lib/agrid_client/models/quote.rb', line 21

def id
  @id
end

#imagesObject

Array of images to ilustrate the quote



30
31
32
# File 'lib/agrid_client/models/quote.rb', line 30

def images
  @images
end

#priceObject

Quote price



27
28
29
# File 'lib/agrid_client/models/quote.rb', line 27

def price
  @price
end

#serviceObject

Service that contain this quote



36
37
38
# File 'lib/agrid_client/models/quote.rb', line 36

def service
  @service
end

#titleObject

Quote title



24
25
26
# File 'lib/agrid_client/models/quote.rb', line 24

def title
  @title
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/agrid_client/models/quote.rb', line 47

def self.attribute_map
  {
    :'id' => :'id',
    :'title' => :'title',
    :'price' => :'price',
    :'images' => :'images',
    :'company' => :'company',
    :'service' => :'service',
    :'categories' => :'categories',
    :'filters' => :'filters',
    :'active_sale' => :'active_sale'
  }
end

.swagger_typesObject

Attribute type mapping.



62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/agrid_client/models/quote.rb', line 62

def self.swagger_types
  {
    :'id' => :'String',
    :'title' => :'String',
    :'price' => :'Float',
    :'images' => :'Array<String>',
    :'company' => :'Company',
    :'service' => :'Service',
    :'categories' => :'Array<Category>',
    :'filters' => :'Array<Filter>',
    :'active_sale' => :'Sale'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



118
119
120
121
122
# File 'lib/agrid_client/models/quote.rb', line 118

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id
end