Class: Flow::Reference::Locales
- Inherits:
-
Object
- Object
- Flow::Reference::Locales
- Defined in:
- lib/flow-reference.rb,
lib/generated/countries.rb
Defined Under Namespace
Classes: Data
Class Method Summary collapse
Class Method Details
.find(locale_code) ⇒ Object
43 44 45 46 47 48 |
# 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) ⇒ Object
50 51 52 |
# File 'lib/flow-reference.rb', line 50 def find!(locale_code) find(locale_code) || raise(ArgumentError, 'Country "%s" is not found' % locale_code) end |