Class: AdvisorsCommandClient::Models::Address

Inherits:
Base
  • Object
show all
Defined in:
lib/advisors_command_client/models/address.rb

Instance Method Summary collapse

Methods inherited from Base

deep_underscore_params, #initialize, load

Constructor Details

This class inherits a constructor from AdvisorsCommandClient::Models::Base

Instance Method Details

#==(other_address) ⇒ Object



28
29
30
# File 'lib/advisors_command_client/models/address.rb', line 28

def ==(other_address)
  full_address.downcase == other_address.full_address.downcase
end

#as_jsonObject



32
33
34
35
36
37
38
39
# File 'lib/advisors_command_client/models/address.rb', line 32

def as_json
  json_attrs = attributes.dup
  json_attrs.delete(:id)
  json_attrs.delete(:types)
  json_attrs.delete(:created_at)
  json_attrs.delete(:updated_at)
  json_attrs.to_camelback_keys
end

#full_addressObject



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

def full_address
  [street, street2, city, region, postal_code, country].compact.join(' ')
end

#regionObject



16
17
18
# File 'lib/advisors_command_client/models/address.rb', line 16

def region
  state_map.key(@region) || @region
end

#region_codeObject



20
21
22
# File 'lib/advisors_command_client/models/address.rb', line 20

def region_code
  state_map[@region] || @region
end