Sha256: 6dd8118772bbbab6795be71b081f29edc501f710ac086c2d536e3cff92b29abc

Contents?: true

Size: 611 Bytes

Versions: 9

Compression:

Stored size: 611 Bytes

Contents

module CryptocoinPayable
  module Adapters
    def self.for(coin_type)
      case coin_type.to_sym
      when :eth
        ethereum_adapter
      when :btc
        bitcoin_adapter
      else
        raise "Invalid coin type #{coin_type}"
      end
    end

    def self.ethereum_adapter
      @ethereum_adapter ||= Ethereum.new
    end

    def self.bitcoin_adapter
      @bitcoin_adapter ||= Bitcoin.new
    end
  end
end

require 'cryptocoin_payable/adapters/base'
require 'cryptocoin_payable/adapters/bitcoin'
require 'cryptocoin_payable/adapters/bitcoin_cash'
require 'cryptocoin_payable/adapters/ethereum'

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
cryptocoin_payable-1.4.3 lib/cryptocoin_payable/adapters.rb
cryptocoin_payable-1.4.2 lib/cryptocoin_payable/adapters.rb
cryptocoin_payable-1.4.1 lib/cryptocoin_payable/adapters.rb
cryptocoin_payable-1.4.0 lib/cryptocoin_payable/adapters.rb
cryptocoin_payable-1.3.0 lib/cryptocoin_payable/adapters.rb
cryptocoin_payable-1.2.0 lib/cryptocoin_payable/adapters.rb
cryptocoin_payable-1.1.0 lib/cryptocoin_payable/adapters.rb
cryptocoin_payable-1.0.1 lib/cryptocoin_payable/adapters.rb
cryptocoin_payable-1.0.0 lib/cryptocoin_payable/adapters.rb