Class: ActionDispatch::Routing::Mapper
- Inherits:
-
Object
- Object
- ActionDispatch::Routing::Mapper
- Defined in:
- lib/authralia.rb
Instance Method Summary collapse
- #when_authticanted(resource_class_name, &block) ⇒ Object
- #when_unauthticanted(resource_class_name, &block) ⇒ Object
Instance Method Details
#when_authticanted(resource_class_name, &block) ⇒ Object
53 54 55 56 57 58 59 60 61 |
# File 'lib/authralia.rb', line 53 def when_authticanted(resource_class_name, &block) constraint = lambda do |request| request.session[resource_class_name.underscore].present? end constraints(constraint) do yield end end |
#when_unauthticanted(resource_class_name, &block) ⇒ Object
63 64 65 66 67 68 69 70 71 |
# File 'lib/authralia.rb', line 63 def when_unauthticanted(resource_class_name, &block) constraint = lambda do |request| request.session[resource_class_name.underscore].blank? end constraints(constraint) do yield end end |