Class: Pipl::Url
Instance Attribute Summary collapse
-
#category ⇒ String
Possible values are: background_reports contact_details email_address media personal_profiles professional_and_business public_records publications school_and_classmates web_pages.
-
#domain ⇒ String
Canonical domain of the url.
-
#name ⇒ String
Name of the website hosting the url.
-
#source_id ⇒ Object
Returns the value of attribute source_id.
-
#sponsored ⇒ String
Unique identifier of this url.
-
#url ⇒ String
Actual Url.
Attributes inherited from Field
#current, #inferred, #last_seen, #valid_since
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Url
constructor
A new instance of Url.
- #is_searchable? ⇒ Boolean
- #to_hash ⇒ Object
Methods inherited from Field
base_params_from_hash, from_hash
Methods included from Utils
alnum_chars, alpha_chars, date_to_str, extract_rate_limits, is_valid_url?, str_to_date, titleize, to_utf8
Constructor Details
#initialize(params = {}) ⇒ Url
Returns a new instance of Url.
548 549 550 551 552 553 554 555 556 |
# File 'lib/pipl/fields.rb', line 548 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
#category ⇒ String
Possible values are:
background_reports
contact_details
email_address
media
personal_profiles
professional_and_business
public_records
publications
school_and_classmates
web_pages
546 |
# File 'lib/pipl/fields.rb', line 546 attr_accessor :url, :category, :domain, :name, :sponsored, :source_id |
#domain ⇒ String
Returns Canonical domain of the url.
546 |
# File 'lib/pipl/fields.rb', line 546 attr_accessor :url, :category, :domain, :name, :sponsored, :source_id |
#name ⇒ String
Returns Name of the website hosting the url.
546 |
# File 'lib/pipl/fields.rb', line 546 attr_accessor :url, :category, :domain, :name, :sponsored, :source_id |
#source_id ⇒ Object
Returns the value of attribute source_id.
546 547 548 |
# File 'lib/pipl/fields.rb', line 546 def source_id @source_id end |
#sponsored ⇒ String
Returns Unique identifier of this url.
546 |
# File 'lib/pipl/fields.rb', line 546 attr_accessor :url, :category, :domain, :name, :sponsored, :source_id |
#url ⇒ String
Returns Actual Url.
546 547 548 |
# File 'lib/pipl/fields.rb', line 546 def url @url end |
Class Method Details
.extra_metadata ⇒ Object
558 559 560 |
# File 'lib/pipl/fields.rb', line 558 def self. [:category, :domain, :name, :sponsored, :source_id] end |
Instance Method Details
#is_searchable? ⇒ Boolean
562 563 564 |
# File 'lib/pipl/fields.rb', line 562 def is_searchable? ! @url.to_s.empty? end |
#to_hash ⇒ Object
566 567 568 |
# File 'lib/pipl/fields.rb', line 566 def to_hash {url: @url} if @url end |