Class: AgridClient::CityCompany

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

Initializes the object

Parameters:

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

    Model attributes in the form of hash



44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/agrid_client/models/city_company.rb', line 44

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[:'city']
    self.city = attributes[:'city']
  end
  if attributes[:'freight']
    self.freight = attributes[:'freight']
  end
end

Instance Attribute Details

#cityObject

The city



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

def city
  @city
end

#freightObject

How much the company charge to attend this city



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

def freight
  @freight
end

Class Method Details

.attribute_mapObject

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



27
28
29
30
31
32
# File 'lib/agrid_client/models/city_company.rb', line 27

def self.attribute_map
  {
    :'city' => :'city',
    :'freight' => :'freight'
  }
end

.swagger_typesObject

Attribute type mapping.



35
36
37
38
39
40
# File 'lib/agrid_client/models/city_company.rb', line 35

def self.swagger_types
  {
    :'city' => :'CityWithFullState',
    :'freight' => :'Float'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



60
61
62
63
64
65
# File 'lib/agrid_client/models/city_company.rb', line 60

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