Method: Strutta::API#initialize

Defined in:
lib/strutta-api.rb

#initialize(token, host = 'http://strutta-api.herokuapp.com/', path = Version::VERSION_PATH) ⇒ Strutta::API

Initializes the Strutta API wrapper

Parameters:

  • token (String)

    your Strutta API token

  • host (String) (defaults to: 'http://strutta-api.herokuapp.com/')

    Strutta API host URL - used to switched between prod/staging

  • path (String) (defaults to: Version::VERSION_PATH)

    Strutta API host path - used to switched between versions



29
30
31
32
33
34
35
36
37
# File 'lib/strutta-api.rb', line 29

def initialize(token, host = 'http://strutta-api.herokuapp.com/', path = Version::VERSION_PATH)
  fail Error, 'You must provide a Strutta API key' unless token

  @host = host
  @path = path
  @token = token
  @session = Excon.new @host
  @debug = debug
end