Class: AgridClient::Address

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

Initializes the object

Parameters:

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

    Model attributes in the form of hash



74
75
76
77
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
# File 'lib/agrid_client/models/address.rb', line 74

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[:'street']
    self.street = attributes[:'street']
  end
  if attributes[:'number']
    self.number = attributes[:'number']
  end
  if attributes[:'complement']
    self.complement = attributes[:'complement']
  end
  if attributes[:'district']
    self.district = attributes[:'district']
  end
  if attributes[:'zipcode']
    self.zipcode = attributes[:'zipcode']
  end
  if attributes[:'city']
    self.city = attributes[:'city']
  end
  if attributes[:'state']
    self.state = attributes[:'state']
  end
  if attributes[:'country']
    self.country = attributes[:'country']
  end
end

Instance Attribute Details

#cityObject

City of company address



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

def city
  @city
end

#complementObject

Additional info of company address



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

def complement
  @complement
end

#countryObject

Country of company address



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

def country
  @country
end

#districtObject

District of company address



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

def district
  @district
end

#numberObject

Number of company address



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

def number
  @number
end

#stateObject

State of company address



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

def state
  @state
end

#streetObject

Street of company address



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

def street
  @street
end

#zipcodeObject

Zipcode of company address



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

def zipcode
  @zipcode
end

Class Method Details

.attribute_mapObject

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



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

def self.attribute_map
  {
    :'street' => :'street',
    :'number' => :'number',
    :'complement' => :'complement',
    :'district' => :'district',
    :'zipcode' => :'zipcode',
    :'city' => :'city',
    :'state' => :'state',
    :'country' => :'country'
  }
end

.swagger_typesObject

Attribute type mapping.



59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/agrid_client/models/address.rb', line 59

def self.swagger_types
  {
    :'street' => :'String',
    :'number' => :'String',
    :'complement' => :'String',
    :'district' => :'String',
    :'zipcode' => :'String',
    :'city' => :'String',
    :'state' => :'String',
    :'country' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/agrid_client/models/address.rb', line 108

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      street == o.street &&
      number == o.number &&
      complement == o.complement &&
      district == o.district &&
      zipcode == o.zipcode &&
      city == o.city &&
      state == o.state &&
      country == o.country
end