Class: FlowCommerce::Reference::Currencies
- Inherits:
-
Object
- Object
- FlowCommerce::Reference::Currencies
- Defined in:
- lib/generated/currencies.rb,
lib/flowcommerce-reference.rb
Defined Under Namespace
Classes: Data
Class Method Summary collapse
Class Method Details
.find(currency_code) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/flowcommerce-reference.rb', line 13 def find(currency_code) code = currency_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!(currency_code) ⇒ Object
20 21 22 |
# File 'lib/flowcommerce-reference.rb', line 20 def find!(currency_code) find(currency_code) || raise(ArgumentError, 'Currency "%s" is not found' % currency_code) end |