Class: Pipl::OriginCountry

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

Instance Attribute Summary collapse

Attributes inherited from Field

#inferred, #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, is_valid_url?, str_to_date, titleize, to_utf8

Constructor Details

#initialize(params = {}) ⇒ OriginCountry

Returns a new instance of OriginCountry.



638
639
640
641
# File 'lib/pipl/fields.rb', line 638

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

Instance Attribute Details

#countryObject

Returns the value of attribute country.



636
637
638
# File 'lib/pipl/fields.rb', line 636

def country
  @country
end

Instance Method Details

#to_sObject



643
644
645
# File 'lib/pipl/fields.rb', line 643

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