Module: Canned::Context::Matchers::Where

Included in:
Actor, Canned::Context::Multi, Resource
Defined in:
lib/canned/context/matchers/where.rb

Defined Under Namespace

Classes: WhereCtx

Instance Method Summary collapse

Instance Method Details

#where(&_block) ⇒ Object

Executes a given block using current resources.

Examples:
   upon { the(:actor) { loads(:resource).where { actor.res_id == resource.id } } }

Parameters:

  • _block (Block)

    Block to be evaluated.



29
30
31
32
# File 'lib/canned/context/matchers/where.rb', line 29

def where(&_block)
  return false unless indeed?
  WhereCtx.new(@stack).instance_eval(&_block)
end