module LightService::Organizer::ClassMethods
In case this module is included
Public Instance Methods
Source
# File lib/light-service/organizer.rb, line 89 def add_aliases(args) execute(->(ctx) { ctx.assign_aliases(ctx.aliases.merge(args)) }) end
Source
# File lib/light-service/organizer.rb, line 76 def add_to_context(args) Context::ReservedKeysViaOrganizerVerifier.new(args).verify Hash(args).map do |key, value| context_key = lambda do |ctx| ctx[key.to_sym] = value ctx.define_accessor_methods_for_keys(key) end execute(context_key) end end
Set the value as a key on the context hash and also create convenience accessors for the keys
Source
# File lib/light-service/organizer.rb, line 58 def execute(code_block) Execute.run(code_block) end
Source
# File lib/light-service/organizer.rb, line 54 def iterate(collection_key, steps) Iterate.run(self, collection_key, steps) end
Source
# File lib/light-service/organizer.rb, line 66 def log_with(logger) @logger = logger end
Source
# File lib/light-service/organizer.rb, line 34 def reduce(*actions) with({}).reduce(actions) end
Source
# File lib/light-service/organizer.rb, line 50 def reduce_case(**args) ReduceCase.run(self, **args) end
Source
# File lib/light-service/organizer.rb, line 38 def reduce_if(condition_block, steps) ReduceIf.run(self, condition_block, steps) end
Source
# File lib/light-service/organizer.rb, line 42 def reduce_if_else(condition_block, if_steps, else_steps) ReduceIfElse.run(self, condition_block, if_steps, else_steps) end
Source
# File lib/light-service/organizer.rb, line 46 def reduce_until(condition_block, steps) ReduceUntil.run(self, condition_block, steps) end
Source
# File lib/light-service/organizer.rb, line 17 def with(data = {}) VerifyCallMethodExists.run(self, caller(1..1).first) data[:_aliases] = @aliases if @aliases if @before_actions data[:_before_actions] = @before_actions.dup @before_actions = nil end if @after_actions data[:_after_actions] = @after_actions.dup @after_actions = nil end WithReducerFactory.make(self).with(data) end
Source
# File lib/light-service/organizer.rb, line 62 def with_callback(action, steps) WithCallback.run(self, action, steps) end