Class: LightService::Organizer::ReduceUntil
- Inherits:
-
Object
- Object
- LightService::Organizer::ReduceUntil
- Extended by:
- ScopedReducable
- Defined in:
- lib/light-service/organizer/reduce_until.rb
Class Method Summary collapse
Methods included from ScopedReducable
Class Method Details
.run(organizer, condition_block, steps) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/light-service/organizer/reduce_until.rb', line 6 def self.run(organizer, condition_block, steps) lambda do |ctx| return ctx if ctx.stop_processing? loop do ctx = scoped_reduce(organizer, ctx, steps) break if condition_block.call(ctx) || ctx.failure? end ctx end end |