Module: Iyzi::Currency
- Defined in:
- lib/iyzi/currency.rb
Constant Summary collapse
- TRY =
'TRY'.freeze
- USD =
'USD'.freeze
- EUR =
'EUR'.freeze
- GBP =
'GBP'.freeze
- IRR =
'IRR'.freeze
- VALID_CURRENCIES =
[TRY, USD, EUR, GBP, IRR].freeze
Class Method Summary collapse
Class Method Details
.find(symbol) ⇒ Object
11 12 13 14 |
# File 'lib/iyzi/currency.rb', line 11 def self.find(symbol) currency = VALID_CURRENCIES.select { |c| c == symbol.to_s.upcase }.first currency.present? ? currency : raise("currency must be one of these: #{VALID_CURRENCIES}") end |