Class: Pipl::Url

Inherits:
Field show all
Defined in:
lib/pipl/fields.rb

Instance Attribute Summary collapse

Attributes inherited from Field

#current, #inferred, #last_seen, #valid_since

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Field

base_params_from_hash, from_hash, #to_hash

Methods included from Utils

alnum_chars, alpha_chars, date_to_str, is_valid_url?, str_to_date, titleize, to_utf8

Constructor Details

#initialize(params = {}) ⇒ Url

Returns a new instance of Url.



547
548
549
550
551
552
553
554
555
# File 'lib/pipl/fields.rb', line 547

def initialize(params={})
  super params
  @url = params[:url]
  @category = params[:category]
  @domain = params[:domain]
  @name = params[:name]
  @sponsored = params[:sponsored]
  @source_id = params[:source_id]
end

Instance Attribute Details

#categoryString

Possible values are:

background_reports
contact_details
email_address
media
personal_profiles
professional_and_business
public_records
publications
school_and_classmates
web_pages

Returns:

  • (String)

    Category of the domain



545
# File 'lib/pipl/fields.rb', line 545

attr_accessor :url, :category, :domain, :name, :sponsored, :source_id

#domainString

Returns Canonical domain of the url.

Returns:

  • (String)

    Canonical domain of the url



545
# File 'lib/pipl/fields.rb', line 545

attr_accessor :url, :category, :domain, :name, :sponsored, :source_id

#nameString

Returns Name of the website hosting the url.

Returns:

  • (String)

    Name of the website hosting the url



545
# File 'lib/pipl/fields.rb', line 545

attr_accessor :url, :category, :domain, :name, :sponsored, :source_id

#source_idObject

Returns the value of attribute source_id.



545
546
547
# File 'lib/pipl/fields.rb', line 545

def source_id
  @source_id
end

Returns Unique identifier of this url.

Returns:

  • (String)

    Unique identifier of this url



545
# File 'lib/pipl/fields.rb', line 545

attr_accessor :url, :category, :domain, :name, :sponsored, :source_id

#urlString

Returns Actual Url.

Returns:

  • (String)

    Actual Url



545
546
547
# File 'lib/pipl/fields.rb', line 545

def url
  @url
end

Class Method Details

.extra_metadataObject



557
558
559
# File 'lib/pipl/fields.rb', line 557

def self.
  [:category, :domain, :name, :sponsored, :source_id]
end

Instance Method Details

#is_searchable?Boolean

Returns:

  • (Boolean)


561
562
563
# File 'lib/pipl/fields.rb', line 561

def is_searchable?
  not @url.to_s.empty?
end