Exception: ActionPolicy::UnrecognizedScopeTarget

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

Instance Method Summary collapse

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

#messageObject (readonly)

Returns the value of attribute message.



42
43
44
# File 'lib/action_policy/policy/scoping.rb', line 42

def message
  @message
end