Class: Pipl::OriginCountry

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

Instance Attribute Summary collapse

Attributes inherited from Field

#current, #inferred, #last_seen, #valid_since

Instance Method Summary collapse

Methods inherited from Field

base_params_from_hash, extra_metadata, from_hash, #is_searchable?, #to_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 = {}) ⇒ OriginCountry

Returns a new instance of OriginCountry.



655
656
657
658
# File 'lib/pipl/fields.rb', line 655

def initialize(params={})
  super params
  @country = params[:country]
end

Instance Attribute Details

#countryObject

Returns the value of attribute country.



653
654
655
# File 'lib/pipl/fields.rb', line 653

def country
  @country
end

Instance Method Details

#to_sObject



660
661
662
# File 'lib/pipl/fields.rb', line 660

def to_s
  Pipl::COUNTRIES[@country.upcase.to_sym] if @country
end