Class: Flow::Reference::Continents
- Inherits:
-
Object
- Object
- Flow::Reference::Continents
- Defined in:
- lib/flow-reference.rb,
lib/generated/continents.rb
Defined Under Namespace
Classes: Data
Class Method Summary collapse
Class Method Details
.find(continent_code) ⇒ Object
58 59 60 61 62 63 |
# File 'lib/flow-reference.rb', line 58 def find(continent_code) code = continent_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!(continent_code) ⇒ Object
65 66 67 |
# File 'lib/flow-reference.rb', line 65 def find!(continent_code) find(continent_code) || raise(ArgumentError, 'Continent "%s" is not found' % continent_code) end |