Class: ActionPolicy::Policy::ExecutionResult
- Inherits:
-
Object
- Object
- ActionPolicy::Policy::ExecutionResult
- Defined in:
- lib/action_policy/policy/execution_result.rb
Overview
Result of applying a policy rule
This class could be extended by some modules to provide additional functionality
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #fail? ⇒ Boolean
-
#load(value) ⇒ Object
Populate the final value.
- #success? ⇒ Boolean
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
10 11 12 |
# File 'lib/action_policy/policy/execution_result.rb', line 10 def value @value end |
Instance Method Details
#fail? ⇒ Boolean
21 22 23 |
# File 'lib/action_policy/policy/execution_result.rb', line 21 def fail? @value == false end |
#load(value) ⇒ Object
Populate the final value
13 14 15 |
# File 'lib/action_policy/policy/execution_result.rb', line 13 def load(value) @value = value end |
#success? ⇒ Boolean
17 18 19 |
# File 'lib/action_policy/policy/execution_result.rb', line 17 def success? @value == true end |