Class: Clearance::Constraints::SignedIn

Inherits:
Object
  • Object
show all
Defined in:
lib/clearance/constraints/signed_in.rb

Instance Method Summary (collapse)

Constructor Details

- (SignedIn) initialize(&block)



4
5
6
# File 'lib/clearance/constraints/signed_in.rb', line 4

def initialize(&block)
  @block = block || lambda { |user| true }
end

Instance Method Details

- (Boolean) matches?(request)



8
9
10
11
# File 'lib/clearance/constraints/signed_in.rb', line 8

def matches?(request)
  @request = request
  signed_in? && current_user_fulfills_additional_requirements?
end