module CarryOut

A Closure Is Not Always A Closure In Ruby - Alan Skorkin www.skorks.com/2013/03/a-closure-is-not-always-a-closure-in-ruby/

Constants

VERSION

Public Class Methods

call_unit(*args, &block) click to toggle source
# File lib/carry_out.rb, line 13
def self.call_unit(*args, &block)
  PlanRunner.call_unit(*args, &block)
end
configuration() click to toggle source
# File lib/carry_out.rb, line 17
def self.configuration
  @configuration ||= {}
end
configure(&block) click to toggle source
# File lib/carry_out.rb, line 21
def self.configure(&block)
  Configurator.new(configuration).instance_eval(&block)
end
plan(options = {}, &block) click to toggle source
# File lib/carry_out.rb, line 25
def self.plan(options = {}, &block)
  merged_options = Hash.new.merge(configuration).merge(options)
  plan = PlanBuilder.build(merged_options, &block)

  Proc.new do |context = nil, &block| 
    PlanRunner.call(plan, context).tap do |result|
      block.call(result) unless block.nil?
    end
  end
end
with_configuration(options = {}) click to toggle source
# File lib/carry_out.rb, line 36
def self.with_configuration(options = {})
  ConfiguredInstance.new(options)
end