class States::Dsl::Parallel

Public Class Methods

new(context) click to toggle source
# File lib/states/dsl/parallel.rb, line 4
def initialize(context)
  @context = context
  @branches = []
end

Public Instance Methods

branch(options={}, &block) click to toggle source
# File lib/states/dsl/parallel.rb, line 9
def branch(options={}, &block)
  branch = ExecutionContext.new(@context, options)
  branch.instance_eval(&block)
  @branches << branch
  branch
end
serializable_hash() click to toggle source
# File lib/states/dsl/parallel.rb, line 16
def serializable_hash
  { "Branches" => @branches.map(&:serializable_hash) }
end