Class: Pipl::Ethnicity

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

Returns a new instance of Ethnicity.



613
614
615
616
# File 'lib/pipl/fields.rb', line 613

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.



611
612
613
# File 'lib/pipl/fields.rb', line 611

def content
  @content
end

Instance Method Details

#to_sObject



618
619
620
# File 'lib/pipl/fields.rb', line 618

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