Class: BitflyerApi::HTTP::Connection

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/bitflyer_api/http/connection.rb

Instance Method Summary collapse

Constructor Details

#initialize(key, secret) ⇒ Connection

Returns a new instance of Connection.



11
12
13
14
15
16
17
18
# File 'lib/bitflyer_api/http/connection.rb', line 11

def initialize(key, secret)
  @conn = Faraday.new(url: "https://api.bitflyer.jp") do |conn|
    conn.request :json
    conn.response :json
    conn.use BitflyerApi::HTTP::Middleware, key, secret
    conn.adapter Faraday.default_adapter
  end
end