Class: Plotly::Client

Inherits:
Object show all
Defined in:
lib/plotly/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(username, api_key) ⇒ Client

Returns a new instance of Client.

Parameters:

  • username (String)
  • api_key (String)


19
20
21
22
23
24
# File 'lib/plotly/client.rb', line 19

def initialize(username, api_key)
  @conn = Faraday.new(
    url: 'https://api.plot.ly/v2',
    headers: build_headers(username, api_key)
  )
end

Instance Attribute Details

#connObject (readonly)

Returns the value of attribute conn.



15
16
17
# File 'lib/plotly/client.rb', line 15

def conn
  @conn
end