Sha256: bde336a7a6eb8079d9c90eb210e42e0730b8b961ff0ef87f9845c35b7f8c724c

Contents?: true

Size: 286 Bytes

Versions: 1

Compression:

Stored size: 286 Bytes

Contents

module Danconia
  class Currency < Struct.new(:code, :symbol, :description, keyword_init: true)
    def self.find code, exchange
      return code if code.is_a? Currency
      new exchange.available_currencies.find { |c| c[:code] == code } || {code: code, symbol: '$'}
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
danconia-0.2.1 lib/danconia/currency.rb