Class: VChainClient::BlockchainAdapterFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/vchain_client/blockchain_adapter_factory.rb

Class Method Summary collapse

Class Method Details

.getAdapter(type, config, app_config) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/vchain_client/blockchain_adapter_factory.rb', line 5

def self.getAdapter(type, config, app_config)
	if type == "bitcoind"
		return VChainClient::BitcoindBlockchainAdapter.new(config["server"], config["port"], config["rpc_username"], config["rpc_password"], config, app_config)

	elsif type == "blockcypher"
		return VChainClient::BlockcypherBlockchainAdapter.new(config["api_token"], config, app_config)
	end

   raise "No such adapter '#{type}'"

end