Class: BitX::Connection

Inherits:
Object
  • Object
show all
Includes:
PrivateApi, PublicApi
Defined in:
lib/bitx.rb

Overview

connection object to be used in concurrent systems where connections and configurations might differ

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from PrivateApi

#api_auth, #authed_request, #balance, #balance_for, #cancel_withdrawal, #create_quote, #discard_quote, #exercise_quote, #extract_quote_from_body, #format_order_hash, #funding_address, #get_order, #list_orders, #new_receive_address, #post_order, #receive_address_request, #received_by_address, #send, #stop_order, #view_quote, #withdraw, #withdrawal, #withdrawals

Methods included from PublicApi

#get, #orderbook, #ticker, #tickers, #trades

Constructor Details

#initialize(connection = nil) {|@configuration| ... } ⇒ Connection

Returns a new instance of Connection.

Yields:



45
46
47
48
49
# File 'lib/bitx.rb', line 45

def initialize(connection=nil)
  @conn = connection || BitX.conn
  @configuration = BitX.configuration
  yield(@configuration) if block_given?
end

Instance Attribute Details

#configurationObject

Returns the value of attribute configuration.



43
44
45
# File 'lib/bitx.rb', line 43

def configuration
  @configuration
end

#connObject

Returns the value of attribute conn.



43
44
45
# File 'lib/bitx.rb', line 43

def conn
  @conn
end

Class Method Details

.configurationObject



59
60
61
# File 'lib/bitx.rb', line 59

def self.configuration
  @configuration
end

.connObject



51
52
53
# File 'lib/bitx.rb', line 51

def self.conn
  @conn
end

.get(url, params = nil) ⇒ Object



55
56
57
# File 'lib/bitx.rb', line 55

def self.get(url, params=nil)
  get(url, params)
end