Class: Rack::Authentication::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/authentication/request.rb

Instance Method Summary collapse

Constructor Details

#initialize(env, config) ⇒ Request

Returns a new instance of Request.



4
5
6
7
8
9
10
11
# File 'lib/rack/authentication/request.rb', line 4

def initialize(env, config)
  @env     = env
  @adapter = config.adapter.new({
    type: type,
    credentials: credentials,
    env: @env
  })
end

Instance Method Details

#authorized? ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/rack/authentication/request.rb', line 13

def authorized?
  @adapter.authorized?
end

#good? ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/rack/authentication/request.rb', line 17

def good?
  @adapter.good?
end

#type ⇒ Object



21
22
23
# File 'lib/rack/authentication/request.rb', line 21

def type
  @type ||= params[0].to_s
end