Class: AgridClient::Location

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

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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

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

Instance Attribute Details

#latObject

Latitude of company address



20
21
22
# File 'lib/agrid_client/models/location.rb', line 20

def lat
  @lat
end

#lonObject

Longitude of company address



23
24
25
# File 'lib/agrid_client/models/location.rb', line 23

def lon
  @lon
end

Class Method Details

.attribute_mapObject

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



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

def self.attribute_map
  {
    :'lat' => :'lat',
    :'lon' => :'lon'
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    :'lat' => :'String',
    :'lon' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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

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