Exception: ActionPolicy::UnrecognizedScopeTarget
- Defined in:
- lib/action_policy/policy/scoping.rb
Overview
:nodoc:
Constant Summary collapse
- MESSAGE_TEMPLATE =
"Couldn't infer scope type for %s instance"
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(target) ⇒ UnrecognizedScopeTarget
constructor
A new instance of UnrecognizedScopeTarget.
Constructor Details
#initialize(target) ⇒ UnrecognizedScopeTarget
Returns a new instance of UnrecognizedScopeTarget.
44 45 46 47 48 49 50 |
# File 'lib/action_policy/policy/scoping.rb', line 44 def initialize(target) target_class = target.is_a?(Module) ? target : target.class @message = format( MESSAGE_TEMPLATE, target_class ) end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
42 43 44 |
# File 'lib/action_policy/policy/scoping.rb', line 42 def @message end |