Module: Atlasq::PartialMatch

Defined in:
lib/atlasq/partial_match.rb

Class Method Summary collapse

Class Method Details

.countries(term) ⇒ Array<String>

Returns 3 digit country codes (ISO3166).

Parameters:

  • term (String)

Returns:

  • (Array<String>)

    3 digit country codes (ISO3166)



7
8
9
10
# File 'lib/atlasq/partial_match.rb', line 7

def self.countries(term)
  @countries ||= Util::WordMap.new(index: Cache.get("search_index/partial_match_country.json"))
  @countries.search(term)
end

.currencies(term) ⇒ Array<String>

Returns 3 letter currency codes (ISO4217).

Parameters:

  • term (String)

Returns:

  • (Array<String>)

    3 letter currency codes (ISO4217)



14
15
16
17
# File 'lib/atlasq/partial_match.rb', line 14

def self.currencies(term)
  @currencies ||= Util::WordMap.new(index: Cache.get("search_index/partial_match_currency.json"))
  @currencies.search(term)
end

.languages(term) ⇒ Array<String>

Returns 2 letter language codes (ISO639).

Parameters:

  • term (String)

Returns:

  • (Array<String>)

    2 letter language codes (ISO639)



21
22
23
24
# File 'lib/atlasq/partial_match.rb', line 21

def self.languages(term)
  @languages ||= Util::WordMap.new(index: Cache.get("search_index/partial_match_language.json"))
  @languages.search(term)
end