Class: HelloBlock::Client

Inherits:
Object
  • Object
show all
Includes:
Connection, Endpoints, Request
Defined in:
lib/helloblock/client.rb,
lib/helloblock/client/request.rb,
lib/helloblock/client/endpoints.rb,
lib/helloblock/client/connection.rb

Defined Under Namespace

Modules: Connection, Endpoints, Request

Constant Summary

Constants included from Endpoints

Endpoints::ADDRESSES_PATH, Endpoints::BLOCKS_PATH, Endpoints::FAUCET_PATH, Endpoints::LATEST_BLOCKS_PATH, Endpoints::LATEST_TRANSACTION_PATH, Endpoints::POST_REQUESTS, Endpoints::PROPAGATE_PATH, Endpoints::TRANSACTIONS_FOR_ADDRESS_PATH, Endpoints::TRANSACTIONS_PATH, Endpoints::UNSPENTS_PATH, Endpoints::WALLET_PATH, Endpoints::WITHDRAWAL_PATH

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Endpoints

#base_url, #endpoint_defined?, #method_missing, #navigate_to_path, #post_request?

Methods included from Request

#get, #post

Constructor Details

#initializeClient

Returns a new instance of Client.



13
14
15
# File 'lib/helloblock/client.rb', line 13

def initialize

end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class HelloBlock::Client::Endpoints

Instance Attribute Details

#networkObject



17
18
19
# File 'lib/helloblock/client.rb', line 17

def network
  @env ||= :testnet # :mainnet
end

Instance Method Details

#target_urlObject



21
22
23
# File 'lib/helloblock/client.rb', line 21

def target_url
  "http://#{network}.helloblock.io"
end