Module: ApiAuth::Rails::ActiveResourceExtension::ActiveResourceApiAuth::ClassMethods

Defined in:
lib/api_auth/railtie.rb

Instance Method Summary collapse

Instance Method Details

#connection_with_auth(refresh = false) ⇒ Object



48
49
50
51
52
53
54
# File 'lib/api_auth/railtie.rb', line 48

def connection_with_auth(refresh = false)
  c = connection_without_auth(refresh)
  c.hmac_access_id = hmac_access_id
  c.hmac_secret_key = hmac_secret_key
  c.use_hmac = use_hmac
  c
end

#with_api_auth(access_id, secret_key, options = {}) ⇒ Object



38
39
40
41
42
43
44
45
46
# File 'lib/api_auth/railtie.rb', line 38

def with_api_auth(access_id, secret_key, options = {})
  self.hmac_access_id = access_id
  self.hmac_secret_key = secret_key
  self.use_hmac = true

  class << self
    alias_method_chain :connection, :auth
  end
end