Class: MingleEvents::MingleHmacAuthAccess

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

Overview

Client for Mingle’s experimental HMAC api auth support

Instance Attribute Summary collapse

Instance Method Summary collapse

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, , api_key, http=Http)
  @base_url = base_url
  @login = 
  @api_key = api_key
  @http = http
end

Instance Attribute Details

#base_urlObject (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