Class: LittleGhost::WorkflowBuilder

Inherits:
AssemblyBuilder show all
Defined in:
lib/little_ghost/assembly_builder.rb

Overview

Builds a Workflow whose Ruby composition block is supplied at runtime. Use a named Workflow subclass's to_builder when the class supplies the composition and runtime configuration supplies its identity or description. perform supplies the underlying dynamic form for trusted application code.

Instance Attribute Summary

Attributes inherited from AssemblyBuilder

#runtime

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AssemblyBuilder

#as_tool, #ask, #assembly_id, #assembly_kind, #build, #call, #definition, #description, #initialize, #start_execution, #stream, #stream_ask, #validate!

Constructor Details

This class inherits a constructor from LittleGhost::AssemblyBuilder

Class Method Details

.assembly_kindObject

:nodoc:



345
# File 'lib/little_ghost/assembly_builder.rb', line 345

def assembly_kind = :workflow

Instance Method Details

#perform(&block) ⇒ Object

Declares the Ruby composition body for dynamic Workflow executions.

Raises:

  • (ArgumentError)


349
350
351
352
353
354
# File 'lib/little_ghost/assembly_builder.rb', line 349

def perform(&block)
  raise ArgumentError, "perform requires a block" unless block

  @mutex.synchronize { @performer = block }
  self
end