Sha256: 20342e8599a11ad152b5fbba16730b171ee7619b01478d1e5a83e4ef8f266681

Contents?: true

Size: 336 Bytes

Versions: 4

Compression:

Stored size: 336 Bytes

Contents

# frozen_string_literal: true

module Capwatch
  class Exchange

    @@rates = {}

    def self.rate_for(symbol)
      raise "No Exchange Rate for #{symbol}" if @@rates[symbol].nil?
      @@rates[symbol]
    end

    def self.rate(symbol, value)
      @@rates[symbol] = value
    end

    def self.rates
      @@rates
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
capwatch-0.2.5 lib/capwatch/exchange.rb
capwatch-0.2.4 lib/capwatch/exchange.rb
capwatch-0.2.3 lib/capwatch/exchange.rb
capwatch-0.2.0 lib/capwatch/exchange.rb