Class: Moceansdk::Auth::Basic

Inherits:
AbstractAuth show all
Defined in:
lib/moceansdk/auth/basic.rb

Instance Method Summary collapse

Constructor Details

#initialize(api_key = nil, api_secret = nil) ⇒ Basic

Returns a new instance of Basic.



5
6
7
8
9
# File 'lib/moceansdk/auth/basic.rb', line 5

def initialize(api_key = nil, api_secret = nil)
  @params = {}
  @params['mocean-api-key'] = api_key unless api_key.nil?
  @params['mocean-api-secret'] = api_secret unless api_secret.nil?
end

Instance Method Details

#api_key=(api_key) ⇒ Object



11
12
13
# File 'lib/moceansdk/auth/basic.rb', line 11

def api_key=(api_key)
  @params['mocean-api-key'] = api_key
end

#api_secret=(api_secret) ⇒ Object



15
16
17
# File 'lib/moceansdk/auth/basic.rb', line 15

def api_secret=(api_secret)
  @params['mocean-api-secret'] = api_secret
end

#auth_methodObject



19
20
21
# File 'lib/moceansdk/auth/basic.rb', line 19

def auth_method
  'basic'
end

#paramsObject



23
24
25
# File 'lib/moceansdk/auth/basic.rb', line 23

def params
  @params
end