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


70
71
72
73
74
75
76
# File 'lib/api_auth/railtie.rb', line 70

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

#with_api_auth(access_id, secret_key) ⇒ Object


60
61
62
63
64
65
66
67
68
# File 'lib/api_auth/railtie.rb', line 60

def with_api_auth(access_id, secret_key)
  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