class Pipl::Email

Constants

RE_EMAIL

Attributes

address[RW]

@!attribute address

@return [String] Plain email address

@!attribute address_md5

@return [String] MD5 hash of the email address

@!attribute type

@return [String] Type of email association to a person. One of `personal` or `work`.

@!attribute disposable

@return [Boolean] Indicating if this email comes from a disposable email provider.

@!attribute email_provider

@return [Boolean] Indicating if this email comes from a well known email provider like gmail or yahoo.
address_md5[RW]

@!attribute address

@return [String] Plain email address

@!attribute address_md5

@return [String] MD5 hash of the email address

@!attribute type

@return [String] Type of email association to a person. One of `personal` or `work`.

@!attribute disposable

@return [Boolean] Indicating if this email comes from a disposable email provider.

@!attribute email_provider

@return [Boolean] Indicating if this email comes from a well known email provider like gmail or yahoo.
disposable[RW]

@!attribute address

@return [String] Plain email address

@!attribute address_md5

@return [String] MD5 hash of the email address

@!attribute type

@return [String] Type of email association to a person. One of `personal` or `work`.

@!attribute disposable

@return [Boolean] Indicating if this email comes from a disposable email provider.

@!attribute email_provider

@return [Boolean] Indicating if this email comes from a well known email provider like gmail or yahoo.
email_provider[RW]

@!attribute address

@return [String] Plain email address

@!attribute address_md5

@return [String] MD5 hash of the email address

@!attribute type

@return [String] Type of email association to a person. One of `personal` or `work`.

@!attribute disposable

@return [Boolean] Indicating if this email comes from a disposable email provider.

@!attribute email_provider

@return [Boolean] Indicating if this email comes from a well known email provider like gmail or yahoo.
type[RW]

@!attribute address

@return [String] Plain email address

@!attribute address_md5

@return [String] MD5 hash of the email address

@!attribute type

@return [String] Type of email association to a person. One of `personal` or `work`.

@!attribute disposable

@return [Boolean] Indicating if this email comes from a disposable email provider.

@!attribute email_provider

@return [Boolean] Indicating if this email comes from a well known email provider like gmail or yahoo.

Public Class Methods

extra_metadata() click to toggle source
# File lib/pipl/fields.rb, line 280
def self.extra_metadata
  [:disposable, :email_provider]
end
new(params={}) click to toggle source
Calls superclass method Pipl::Field::new
# File lib/pipl/fields.rb, line 271
def initialize(params={})
  super params
  @address = params[:address]
  @address_md5 = params[:address_md5]
  @type = params[:type]
  @disposable = params[:disposable]
  @email_provider = params[:email_provider]
end

Public Instance Methods

domain() click to toggle source
# File lib/pipl/fields.rb, line 300
def domain
  @address.split('@')[1] if is_valid_email?
end
is_searchable?() click to toggle source
# File lib/pipl/fields.rb, line 288
def is_searchable?
  is_valid_email? or (not @address_md5.nil? and @address_md5.length == 32)
end
is_valid_email?() click to toggle source
# File lib/pipl/fields.rb, line 284
def is_valid_email?
  not RE_EMAIL.match(@address).nil?
end
to_hash() click to toggle source
# File lib/pipl/fields.rb, line 292
def to_hash
  {address: @address, address_md5: @address_md5}.reject { |_, value| value.nil? }
end
username() click to toggle source
# File lib/pipl/fields.rb, line 296
def username
  @address.split('@')[0] if is_valid_email?
end