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.
11 12 13 14 15 |
# File 'lib/action_policy/policy/core.rb', line 11 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.
9 10 11 |
# File 'lib/action_policy/policy/core.rb', line 9 def @message end |
#policy ⇒ Object (readonly)
Returns the value of attribute policy.
9 10 11 |
# File 'lib/action_policy/policy/core.rb', line 9 def policy @policy end |
#rule ⇒ Object (readonly)
Returns the value of attribute rule.
9 10 11 |
# File 'lib/action_policy/policy/core.rb', line 9 def rule @rule end |