Module: Protector::DSL::Entry::ClassMethods

Defined in:
lib/protector/dsl.rb

Instance Method Summary collapse

Instance Method Details

#protect {|subject, instance| ... } ⇒ Object

Registers protection DSL block

Yields:

  • (subject, instance)

    Evaluates conditions described in terms of Meta::Box.

Yield Parameters:

  • subject (Object)

    Subject that object was restricted with

  • instance (Object)

    Reference to the object being restricted (can be nil)



269
270
271
# File 'lib/protector/dsl.rb', line 269

def protect(&block)
  protector_meta << block
end

#protector_metaObject

Storage of Meta



274
275
276
# File 'lib/protector/dsl.rb', line 274

def protector_meta
  @protector_meta ||= Meta.new
end