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)


11
12
13
14
15
16
# File 'lib/plotly/client.rb', line 11

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.



7
8
9
# File 'lib/plotly/client.rb', line 7

def conn
  @conn
end