Class: Hover::Client::HMAC
Direct Known Subclasses
Instance Attribute Summary collapse
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
Returns the value of attribute client_secret.
Attributes inherited from HTTP
Instance Method Summary collapse
- #authenticate(request) ⇒ Object
-
#initialize(client_id, client_secret, site = 'http://localhost:3000', prefix = 'api/v1') ⇒ HMAC
constructor
A new instance of HMAC.
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_id ⇒ Object
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_secret ⇒ Object
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 |