module Protector::DSL::Entry::ClassMethods

Public Instance Methods

ensure_protector_meta!(adapter, &column_names) click to toggle source
# File lib/protector/dsl.rb, line 331
def ensure_protector_meta!(adapter, &column_names)
  @protector_meta ||= if superclass && superclass.respond_to?(:protector_meta)
    superclass.protector_meta.inherit(self, &column_names)
  else
    Protector::DSL::Meta.new(adapter, self, &column_names)
  end
end
protect(&block) click to toggle source

Registers protection DSL block @yield [subject, instance] Evaluates conditions described in terms of {Protector::DSL::Meta::Box}. @yieldparam subject [Object] Subject that object was restricted with @yieldparam instance [Object] Reference to the object being restricted (can be nil)

# File lib/protector/dsl.rb, line 327
def protect(&block)
  protector_meta << block
end