Class: Semantics3::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/semantics3.rb

Direct Known Subclasses

Products

Instance Method Summary collapse

Constructor Details

#initialize(api_key, api_secret, auth = "oauth") ⇒ Base

Returns a new instance of Base.

Raises:



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/semantics3.rb', line 19

def initialize(api_key,api_secret,auth = "oauth")
    @api_key = api_key
    @api_secret = api_secret
    @auth_method = auth

    raise Error.new('API Credentials Missing','You did not supply an api_key. Please sign up at https://semantics3.com/ to obtain your api_key.','api_key') if api_key == ''
    raise Error.new('API Credentials Missing','You did not supply an api_secret. Please sign up at https://semantics3.com/ to obtain your api_secret.','api_secret') if api_secret == ''

    @consumer = OAuth::Consumer.new(@api_key, @api_secret)
    @auth = OAuth::AccessToken.new(@consumer)
end