Class: LightService::Organizer::ReduceIf

Inherits:
Object
  • Object
show all
Extended by:
ScopedReducable
Defined in:
lib/light-service/organizer/reduce_if.rb

Class Method Summary collapse

Methods included from ScopedReducable

scoped_reduce

Class Method Details

.run(organizer, condition_block, steps) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/light-service/organizer/reduce_if.rb', line 6

def self.run(organizer, condition_block, steps)
  lambda do |ctx|
    return ctx if ctx.stop_processing?

    ctx = scoped_reduce(organizer, ctx, steps) \
            if condition_block.call(ctx)
    ctx
  end
end