Class: Pipl::Ethnicity

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 = {}) ⇒ Ethnicity

Returns a new instance of Ethnicity.



602
603
604
605
# File 'lib/pipl/fields.rb', line 602

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

Instance Attribute Details

#contentString

Possible values are:

white
black
american_indian
alaska_native
asian_indian
chinese
filipino
other_asian
japanese
korean
vietnamese
native_hawaiian
guamanian
chamorro
samoan
other_pacific_islander
other

Returns:

  • (String)

    Ethnicity name based on the U.S Census Bureau.



600
601
602
# File 'lib/pipl/fields.rb', line 600

def content
  @content
end

Instance Method Details

#to_sObject



607
608
609
# File 'lib/pipl/fields.rb', line 607

def to_s
  Pipl::Utils.titleize @content.gsub(/_/, ' ') if @content
end