Exception: ActionPolicy::UnknownScopeType

Inherits:
Error
  • Object
show all
Includes:
SuggestMessage
Defined in:
lib/action_policy/policy/scoping.rb

Overview

:nodoc:

Constant Summary collapse

MESSAGE_TEMPLATE =
"Unknown policy scope type :%s for %s%s"

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SuggestMessage

#suggest

Constructor Details

#initialize(policy_class, type) ⇒ UnknownScopeType

Returns a new instance of UnknownScopeType.



15
16
17
18
19
20
21
# File 'lib/action_policy/policy/scoping.rb', line 15

def initialize(policy_class, type)
  @message = format(
    MESSAGE_TEMPLATE,
    type, policy_class,
    suggest(type, policy_class.scoping_handlers.keys)
  )
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



13
14
15
# File 'lib/action_policy/policy/scoping.rb', line 13

def message
  @message
end