Method: ActionPolicy::Policy::Scoping::ClassMethods#scoping_handlers

Defined in:
lib/action_policy/policy/scoping.rb

#scoping_handlersObject



127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/action_policy/policy/scoping.rb', line 127

def scoping_handlers
  return @scoping_handlers if instance_variable_defined?(:@scoping_handlers)

  @scoping_handlers =
    Hash.new { |h, k| h[k] = {} }.tap do |handlers|
      if superclass.respond_to?(:scoping_handlers)
        superclass.scoping_handlers.each do |k, v|
          handlers[k] = v.dup
        end
      end
    end
end