Class: AgridClient::PaginatedQuotes

Inherits:
Object
  • Object
show all
Includes:
SwaggerModel
Defined in:
lib/agrid_client/models/paginated_quotes.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 = {}) ⇒ PaginatedQuotes

Initializes the object

Parameters:

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

    Model attributes in the form of hash



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/agrid_client/models/paginated_quotes.rb', line 49

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[:'quotes']
    self.quotes = attributes[:'quotes']
  end
  if attributes[:'count']
    self.count = attributes[:'count']
  end
  if attributes[:'price_ranges']
    if (value = attributes[:'price_ranges']).is_a?(Array)
      self.price_ranges = value
    end
  end
end

Instance Attribute Details

#countObject

Number of quotes that match with parameters



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

def count
  @count
end

#price_rangesObject

PriceRanges are the three points that divide the data set into four equal groups, each group comprising a quarter of the data



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

def price_ranges
  @price_ranges
end

#quotesObject

Quotes filtered using parameters



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

def quotes
  @quotes
end

Class Method Details

.attribute_mapObject

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



30
31
32
33
34
35
36
# File 'lib/agrid_client/models/paginated_quotes.rb', line 30

def self.attribute_map
  {
    :'quotes' => :'quotes',
    :'count' => :'count',
    :'price_ranges' => :'price_ranges'
  }
end

.swagger_typesObject

Attribute type mapping.



39
40
41
42
43
44
45
# File 'lib/agrid_client/models/paginated_quotes.rb', line 39

def self.swagger_types
  {
    :'quotes' => :'Array<Quote>',
    :'count' => :'Integer',
    :'price_ranges' => :'Array<PriceRange>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



70
71
72
73
74
75
76
# File 'lib/agrid_client/models/paginated_quotes.rb', line 70

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      quotes == o.quotes &&
      count == o.count &&
      price_ranges == o.price_ranges
end