Class: Fcoin::RealTime::API

Inherits:
Object
  • Object
show all
Includes:
EndPoint
Defined in:
lib/fcoin/realtime/api.rb

Direct Known Subclasses

Client

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from EndPoint

#on_candle, #on_depth, #on_hello, #on_ticker, #on_topics, #on_trade

Methods included from WSS

#subscribe

Constructor Details

#initialize(options = {}) ⇒ API

Returns a new instance of API.

Parameters:

  • options (Hash) (defaults to: {})

    the options to setting Fcoin Setting. For example, Validation and so on.

Options Hash (options):

  • :adapter(Faraday.default_adapter) (String)
  • :endpoint(https://api.fcoin.com/v2/) (String)

    REST API endpoint

  • :wss_endpoint(wss://api.fcoin.com/v2/ws) (String)

    Websocket endpoint

  • :user_agent (String)
  • :proxy(nil) (String)
  • :ca_path (String)
  • :ca_file (String)
  • :middlewares (Array<Faraday::Middleware>)

    request faraday middlewares

  • :api_key (String)
  • :secret_key (String)
  • :skip_validation(true) (Boolean)
  • :validation_setting_path (String)

    configuration file path for validation



24
25
26
27
28
29
30
31
# File 'lib/fcoin/realtime/api.rb', line 24

def initialize(options={})
  merged_options = Fcoin.options.merge(options)
  Configuration::VALID_OPTIONS_KEYS.each do |key|
    send("#{key}=", merged_options[key])
  end
  self.callbacks    = {}
  self.topics       = []
end

Instance Attribute Details

#callbacksObject

Returns the value of attribute callbacks.



9
10
11
# File 'lib/fcoin/realtime/api.rb', line 9

def callbacks
  @callbacks
end

#topicsObject

Returns the value of attribute topics.



9
10
11
# File 'lib/fcoin/realtime/api.rb', line 9

def topics
  @topics
end