Class: Sinatra::LazyAuth::LazyCredentials

Inherits:
Object
  • Object
show all
Defined in:
lib/sinatra/lazy_auth.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ LazyCredentials

Returns a new instance of LazyCredentials.



8
9
10
11
# File 'lib/sinatra/lazy_auth.rb', line 8

def initialize(app)
  @app = app
  @provided = false
end

Instance Method Details

#passwordObject



18
19
20
21
# File 'lib/sinatra/lazy_auth.rb', line 18

def password
  credentials!
  @password
end

#provided?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/sinatra/lazy_auth.rb', line 23

def provided?
  @provided
end

#userObject



13
14
15
16
# File 'lib/sinatra/lazy_auth.rb', line 13

def user
  credentials!
  @user
end