Exception: ActionPolicy::UnknownRule
- Includes:
- SuggestMessage
- Defined in:
- lib/action_policy/policy/core.rb
Overview
Raised when ‘resolve_rule` failed to find an approriate policy rule method for the activity
Direct Known Subclasses
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.
Methods included from SuggestMessage
Constructor Details
#initialize(policy, rule) ⇒ UnknownRule
Returns a new instance of UnknownRule.
23 24 25 26 27 28 |
# File 'lib/action_policy/policy/core.rb', line 23 def initialize(policy, rule) @policy = policy.class @rule = rule @message = "Couldn't find rule '#{@rule}' for #{@policy}" \ "#{suggest(@rule, @policy.instance_methods - Object.instance_methods)}" end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
21 22 23 |
# File 'lib/action_policy/policy/core.rb', line 21 def @message end |
#policy ⇒ Object (readonly)
Returns the value of attribute policy.
21 22 23 |
# File 'lib/action_policy/policy/core.rb', line 21 def policy @policy end |
#rule ⇒ Object (readonly)
Returns the value of attribute rule.
21 22 23 |
# File 'lib/action_policy/policy/core.rb', line 21 def rule @rule end |