Class: Passpartu::BlockVerify
- Defined in:
- lib/passpartu/block_verify.rb
Defined Under Namespace
Classes: BlockMissedError
Constant Summary collapse
- MAYBE_VALUE =
'maybe'
Constants inherited from Verify
Instance Attribute Summary
Attributes inherited from Verify
#block, #except, #keys, #only, #policy_hash, #result, #role
Instance Method Summary collapse
Methods inherited from Verify
Constructor Details
This class inherits a constructor from Passpartu::Verify
Instance Method Details
#call ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/passpartu/block_verify.rb', line 8 def call policy_result = super raise BlockMissedError, "Block is required for 'maybe' allowed resource" if maybe? && block.nil? return policy_result if block.nil? policy_result && block.call end |