Exception: ActionPolicy::UnknownRule
- Defined in:
- lib/action_policy/policy/core.rb
Overview
Raised when ‘resolve_rule` failed to find an approriate policy rule method for the activity
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#policy ⇒ Object
readonly
Returns the value of attribute policy.
-
#rule ⇒ Object
readonly
Returns the value of attribute rule.
Instance Method Summary collapse
-
#initialize(policy, rule) ⇒ UnknownRule
constructor
A new instance of UnknownRule.
Constructor Details
#initialize(policy, rule) ⇒ UnknownRule
Returns a new instance of UnknownRule.
17 18 19 20 21 |
# File 'lib/action_policy/policy/core.rb', line 17 def initialize(policy, rule) @policy = policy.class @rule = rule @message = "Couldn't find rule '#{@rule}' for #{@policy}" end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
15 16 17 |
# File 'lib/action_policy/policy/core.rb', line 15 def @message end |
#policy ⇒ Object (readonly)
Returns the value of attribute policy.
15 16 17 |
# File 'lib/action_policy/policy/core.rb', line 15 def policy @policy end |
#rule ⇒ Object (readonly)
Returns the value of attribute rule.
15 16 17 |
# File 'lib/action_policy/policy/core.rb', line 15 def rule @rule end |