Class: ActionPolicy::Policy::ExecutionResult

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Instance Attribute Details

#valueObject (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

Returns:

  • (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

Returns:

  • (Boolean)


17
18
19
# File 'lib/action_policy/policy/execution_result.rb', line 17

def success?
  @value == true
end