Method: Orchestrate::Client#initialize
- Defined in:
- lib/orchestrate/client.rb
permalink #initialize(api_key, host = "https://api.orchestrate.io") {|The| ... } ⇒ Object
TODO:
api_key -> app_url, parse api_key from auth section of url
Instantiate a new Client for an Orchestrate application.
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/orchestrate/client.rb', line 28 def initialize(api_key, host="https://api.orchestrate.io", &block) @api_key = api_key @host = host @faraday_configuration = block @http = Faraday.new(@host) do |faraday| block = lambda{|f| f.adapter :net_http_persistent } unless block block.call faraday # faraday seems to want you do specify these twice. faraday.request :basic_auth, api_key, '' faraday.basic_auth api_key, '' end end |