Class: OKCupid::EthnicityFilter

Inherits:
Filter
  • Object
show all
Defined in:
lib/lonely_coder/search/options/ethnicity.rb

Instance Attribute Summary

Attributes inherited from Filter

#code, #name, #value

Instance Method Summary collapse

Methods inherited from Filter

#allowed_values, #initialize, #to_param

Constructor Details

This class inherits a constructor from OKCupid::Filter

Instance Method Details

#lookup(values) ⇒ Object



3
4
5
6
# File 'lib/lonely_coder/search/options/ethnicity.rb', line 3

def lookup(values)
  # lookup the race values and sum them. I think OKC is doing some kind of base2 math on them
  values.collect {|v| MagicNumbers::Ethnicity[v.downcase]}.inject(0, :+)
end