Class: Blockcypher::Client

Inherits:
Object
  • Object
show all
Includes:
Api
Defined in:
lib/blockcypher/client.rb,
lib/blockcypher/client/api.rb,
lib/blockcypher/client/version.rb

Defined Under Namespace

Modules: Api

Constant Summary collapse

VERSION =
"0.0.2"

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Api

#address, #blocks, #chain, #create_address, #transactions

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



13
14
15
16
17
18
19
20
# File 'lib/blockcypher/client.rb', line 13

def initialize(options = {})
  chain = options[:chain] || :main
  coin = options[:coin] || :btc
  @config = Config.new(
    URI("https://api.blockcypher.com/v1/#{coin}/#{chain}"), 
    options[:token]
  )
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



11
12
13
# File 'lib/blockcypher/client.rb', line 11

def config
  @config
end