module NetProspex::Api::HasPhones

Public Class Methods

new(*args) click to toggle source
Calls superclass method
# File lib/netprospex/api/sub_objects.rb, line 3
def initialize(*args)
  super(*args)
  self.phones ||= []
  self.phones.map! do |phone|
    if phone.is_a? Hash
      if phone[:national_number] && !phone[:national_number].empty?
        NetProspex::Api::Phone.new(phone)
      else
        nil
      end
    else
      phone
    end
  end
  self.phones.compact!
end