Class: Economy::Currencies

Inherits:
Object
  • Object
show all
Defined in:
lib/economy/currencies.rb

Instance Method Summary collapse

Instance Method Details

#add(*args) ⇒ Object



12
13
14
15
# File 'lib/economy/currencies.rb', line 12

def add(*args)
  currency = Currency.new(*args)
  registry[currency.iso_code] = currency
end

#find(id) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/economy/currencies.rb', line 4

def find(id)
  if registry.has_key?(id)
    registry[id]
  else
    raise "Currency #{id} not found"
  end
end