class AgridClient::Address

Attributes

city[RW]

City of company address

complement[RW]

Additional info of company address

country[RW]

Country of company address

district[RW]

District of company address

number[RW]

Number of company address

state[RW]

State of company address

street[RW]

Street of company address

zipcode[RW]

Zipcode of company address

Public Class Methods

attribute_map() click to toggle source

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

# 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
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash

# 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
swagger_types() click to toggle source

Attribute type mapping.

# 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

Public Instance Methods

==(o) click to toggle source

Checks equality by comparing each attribute. @param [Object] Object to be compared

# 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