Class: Hover::Client::HMAC

Inherits:
HTTP
  • Object
show all
Defined in:
lib/hover/client/hmac.rb

Direct Known Subclasses

Hover

Instance Attribute Summary collapse

Attributes inherited from HTTP

#prefix, #site

Instance Method Summary collapse

Methods inherited from HTTP

#delete, #get, #get_redirect_location, #make_form_request, #make_request, #make_uri, #parse_response, #patch, #post, #put, #raise_errors, #raise_errors_for_cloudfront_response

Constructor Details

#initialize(client_id, client_secret, site = 'http://localhost:3000', prefix = 'api/v1') ⇒ HMAC

Returns a new instance of HMAC.



8
9
10
11
12
13
# File 'lib/hover/client/hmac.rb', line 8

def initialize(client_id, client_secret, site = 'http://localhost:3000', prefix = 'api/v1')
  super(site, prefix)
  
  self.client_id = client_id
  self.client_secret = client_secret
end

Instance Attribute Details

#client_idObject

Returns the value of attribute client_id.



6
7
8
# File 'lib/hover/client/hmac.rb', line 6

def client_id
  @client_id
end

#client_secretObject

Returns the value of attribute client_secret.



6
7
8
# File 'lib/hover/client/hmac.rb', line 6

def client_secret
  @client_secret
end

Instance Method Details

#authenticate(request) ⇒ Object



15
16
17
# File 'lib/hover/client/hmac.rb', line 15

def authenticate(request)
  ApiAuth.sign!(request, client_id, client_secret)
end