class Flow::Reference::Locales

Public Class Methods

find(locale_code) click to toggle source
# File lib/flow-reference.rb, line 43
def find(locale_code)
  code = locale_code.to_s.downcase.gsub(/[^\w]/,"").capitalize
  return nil unless code.length == 3
  return nil unless Data.respond_to?(code)
  Data.send(code)
end
find!(locale_code) click to toggle source
# File lib/flow-reference.rb, line 50
def find!(locale_code)
  find(locale_code) || raise(ArgumentError, 'Country "%s" is not found' % locale_code)
end