Module: NetProspex::Api::HasAddress

Included in:
Organization, Person
Defined in:
lib/netprospex/api/sub_objects.rb

Instance Method Summary collapse

Instance Method Details

#initialize(*args) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/netprospex/api/sub_objects.rb', line 21

def initialize(*args)
  super(*args)
  if self.postal_address.is_a? Hash
    formatted_address = self.postal_address[:formatted_address]
    if formatted_address && !formatted_address.empty?
      self.postal_address = NetProspex::Api::Address.new(self.postal_address)
    else
      self.postal_address = nil
    end
  end
end