Module: Sinatra::Doorman::Base::Helpers
- Defined in:
- lib/doorman/base.rb
Instance Method Summary collapse
- #authenticated? ⇒ Boolean (also: #logged_in?)
- #notify(type, message) ⇒ Object
- #token_link(type, user) ⇒ Object
Instance Method Details
#authenticated? ⇒ Boolean Also known as: logged_in?
43 44 45 |
# File 'lib/doorman/base.rb', line 43 def authenticated? env['warden'].authenticated? end |
#notify(type, message) ⇒ Object
48 49 50 51 |
# File 'lib/doorman/base.rb', line 48 def notify(type, ) = Messages[] if .is_a?(Symbol) flash[type] = if defined?(Rack::Flash) end |
#token_link(type, user) ⇒ Object
53 54 55 |
# File 'lib/doorman/base.rb', line 53 def token_link(type, user) "http://#{env['HTTP_HOST']}/#{type}/#{user.confirm_token}" end |