Sha256: 40f1474e5d0bedb6d310ad8c3b30d86e53ef14b7fe6bfbed8a2c7cf05fe0649d
Contents?: true
Size: 788 Bytes
Versions: 1
Compression:
Stored size: 788 Bytes
Contents
require 'transproc' require 'transflow/step_dsl' require 'transflow/transaction' module Transflow class FlowDSL module Registry extend Transproc::Registry end def self.[](op) if op.respond_to?(:>>) op else Registry[op] end end attr_reader :options attr_reader :container attr_reader :steps def initialize(options, &block) @options = options @container = options.fetch(:container) @steps = {} instance_exec(&block) end def step(*args, &block) StepDSL.new(*args, container, steps, &block).call end def call Transaction.new(steps, operations.reduce(:>>)) end def operations steps.values.reverse.map { |op| self.class[op] } end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
transflow-0.0.2 | lib/transflow/flow_dsl.rb |