Class: MingleEvents::MingleHmacAuthAccess
- Inherits:
-
Object
- Object
- MingleEvents::MingleHmacAuthAccess
- Defined in:
- lib/mingle_events/mingle_hmac_auth_access.rb
Overview
Client for Mingle’s experimental HMAC api auth support
Instance Attribute Summary collapse
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
Instance Method Summary collapse
- #fetch_page(location) ⇒ Object
-
#initialize(base_url, login, api_key, http = Http) ⇒ MingleHmacAuthAccess
constructor
A new instance of MingleHmacAuthAccess.
Constructor Details
#initialize(base_url, login, api_key, http = Http) ⇒ MingleHmacAuthAccess
Returns a new instance of MingleHmacAuthAccess.
6 7 8 9 10 11 |
# File 'lib/mingle_events/mingle_hmac_auth_access.rb', line 6 def initialize(base_url, login, api_key, http=Http) @base_url = base_url @login = login @api_key = api_key @http = http end |
Instance Attribute Details
#base_url ⇒ Object (readonly)
Returns the value of attribute base_url.
4 5 6 |
# File 'lib/mingle_events/mingle_hmac_auth_access.rb', line 4 def base_url @base_url end |
Instance Method Details
#fetch_page(location) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/mingle_events/mingle_hmac_auth_access.rb', line 13 def fetch_page(location) location = @base_url + location if location[0..0] == '/' @http.get(location) do |req| ApiAuth.sign!(req, @login, @api_key) end end |