class Pipl::Phone

Attributes

country_code[RW]

@!attribute country_code

@return [Fixnum] International country calling code

@!attribute number

@return [Fixnum] Actual phone number

@!attribute extension

@return [String] Office extension

@!attribute type

@return [String] Type of association of this phone to a person.
Possible values are:
  mobile
  home_phone
  home_fax
  work_phone
  work_fax
  pager

@!attribute raw

@return [String] Unparsed phone number

@!attribute display

@return [String] Well formatted representation of this phone number for display purposes.

@!attribute display_international

@return [String] Well formatted international representation of this phone number for display purposes.
display[RW]

@!attribute country_code

@return [Fixnum] International country calling code

@!attribute number

@return [Fixnum] Actual phone number

@!attribute extension

@return [String] Office extension

@!attribute type

@return [String] Type of association of this phone to a person.
Possible values are:
  mobile
  home_phone
  home_fax
  work_phone
  work_fax
  pager

@!attribute raw

@return [String] Unparsed phone number

@!attribute display

@return [String] Well formatted representation of this phone number for display purposes.

@!attribute display_international

@return [String] Well formatted international representation of this phone number for display purposes.
display_international[RW]

@!attribute country_code

@return [Fixnum] International country calling code

@!attribute number

@return [Fixnum] Actual phone number

@!attribute extension

@return [String] Office extension

@!attribute type

@return [String] Type of association of this phone to a person.
Possible values are:
  mobile
  home_phone
  home_fax
  work_phone
  work_fax
  pager

@!attribute raw

@return [String] Unparsed phone number

@!attribute display

@return [String] Well formatted representation of this phone number for display purposes.

@!attribute display_international

@return [String] Well formatted international representation of this phone number for display purposes.
extension[RW]

@!attribute country_code

@return [Fixnum] International country calling code

@!attribute number

@return [Fixnum] Actual phone number

@!attribute extension

@return [String] Office extension

@!attribute type

@return [String] Type of association of this phone to a person.
Possible values are:
  mobile
  home_phone
  home_fax
  work_phone
  work_fax
  pager

@!attribute raw

@return [String] Unparsed phone number

@!attribute display

@return [String] Well formatted representation of this phone number for display purposes.

@!attribute display_international

@return [String] Well formatted international representation of this phone number for display purposes.
number[RW]

@!attribute country_code

@return [Fixnum] International country calling code

@!attribute number

@return [Fixnum] Actual phone number

@!attribute extension

@return [String] Office extension

@!attribute type

@return [String] Type of association of this phone to a person.
Possible values are:
  mobile
  home_phone
  home_fax
  work_phone
  work_fax
  pager

@!attribute raw

@return [String] Unparsed phone number

@!attribute display

@return [String] Well formatted representation of this phone number for display purposes.

@!attribute display_international

@return [String] Well formatted international representation of this phone number for display purposes.
raw[RW]

@!attribute country_code

@return [Fixnum] International country calling code

@!attribute number

@return [Fixnum] Actual phone number

@!attribute extension

@return [String] Office extension

@!attribute type

@return [String] Type of association of this phone to a person.
Possible values are:
  mobile
  home_phone
  home_fax
  work_phone
  work_fax
  pager

@!attribute raw

@return [String] Unparsed phone number

@!attribute display

@return [String] Well formatted representation of this phone number for display purposes.

@!attribute display_international

@return [String] Well formatted international representation of this phone number for display purposes.
type[RW]

@!attribute country_code

@return [Fixnum] International country calling code

@!attribute number

@return [Fixnum] Actual phone number

@!attribute extension

@return [String] Office extension

@!attribute type

@return [String] Type of association of this phone to a person.
Possible values are:
  mobile
  home_phone
  home_fax
  work_phone
  work_fax
  pager

@!attribute raw

@return [String] Unparsed phone number

@!attribute display

@return [String] Well formatted representation of this phone number for display purposes.

@!attribute display_international

@return [String] Well formatted international representation of this phone number for display purposes.

Public Class Methods

extra_metadata() click to toggle source
# File lib/pipl/fields.rb, line 238
def self.extra_metadata
  [:display_international]
end
new(params={}) click to toggle source
Calls superclass method Pipl::Field::new
# File lib/pipl/fields.rb, line 227
def initialize(params={})
  super params
  @country_code = params[:country_code]
  @number = params[:number]
  @extension = params[:extension]
  @type = params[:type]
  @raw = params[:raw]
  @display = params[:display]
  @display_international = params[:display_international]
end

Public Instance Methods

is_searchable?() click to toggle source
# File lib/pipl/fields.rb, line 247
def is_searchable?
  (@raw and not @raw.empty?) or not @number.nil?
end
to_hash() click to toggle source
# File lib/pipl/fields.rb, line 242
def to_hash
  {country_code: @country_code, number: @number, extension: @extension, raw: @raw}
      .reject { |_, value| value.nil? }
end