Module: Fugle Private

Defined in:
lib/fugle.rb,
lib/fugle/http.rb,
lib/fugle/trade.rb,
lib/fugle/utils.rb,
lib/fugle/config.rb,
lib/fugle/version.rb,
lib/fugle/http/api.rb,
lib/fugle/intraday.rb,
lib/fugle/response.rb,
lib/fugle/websocket.rb,
lib/fugle/http/query.rb,
lib/fugle/http/client.rb,
lib/fugle/information.rb,
lib/fugle/intraday/meta.rb,
lib/fugle/intraday/chart.rb,
lib/fugle/intraday/quote.rb,
lib/fugle/http/parameters.rb,
lib/fugle/intraday/trades.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

The Fugle.tw API Client

Defined Under Namespace

Modules: HTTP, Intraday, Utils, WebSocket Classes: Config, Error, Information, Response, Trade

Constant Summary collapse

LOCK =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0

Mutex.new
VERSION =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

'0.1.0'

Class Method Summary collapse

Class Method Details

.config(&block) ⇒ Fugle::Config

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The Fugle Config

Parameters:

  • block (Proc)

    the configure block

Returns:

Since:

  • 0.1.0



29
30
31
32
33
# File 'lib/fugle.rb', line 29

def self.config(&block)
  @config ||= Config.new
  @config.instance_eval(&block) if block_given?
  @config
end

.httpObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



54
55
56
# File 'lib/fugle.rb', line 54

def self.http
  HTTP::Client.new
end

.intradayObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



60
61
62
# File 'lib/fugle.rb', line 60

def self.intraday
  http.intraday
end

.use(config, &_block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Temporary change config

Parameters:

  • config (Fugle::Config)

    the config object

  • block (Proc)

    the temporary working block

Since:

  • 0.1.0



42
43
44
45
46
47
48
49
50
# File 'lib/fugle.rb', line 42

def self.use(config, &_block)
  LOCK.synchronize do
    temp = Fugle.config
    @config = config
    res = yield
    @config = temp
    res
  end
end