Module: RubyReactor::Dsl::TemplateHelpers

Includes:
StepSignals
Included in:
AsyncReactorBuilder, ComposeBuilder, MapBuilder, Reactor::ClassMethods, StepBuilder
Defined in:
lib/ruby_reactor/dsl/template_helpers.rb

Constant Summary

Constants included from StepSignals

StepSignals::TAG

Instance Method Summary collapse

Methods included from StepSignals

#fail!, #halt!, #skip!, #success!

Instance Method Details

#element(map_name, path = nil) ⇒ Object



20
21
22
# File 'lib/ruby_reactor/dsl/template_helpers.rb', line 20

def element(map_name, path = nil)
  RubyReactor::Template::Element.new(map_name, path)
end

#Failure(error) ⇒ Object

rubocop:disable Naming/MethodName



32
33
34
35
# File 'lib/ruby_reactor/dsl/template_helpers.rb', line 32

def Failure(error)
  # rubocop:enable Naming/MethodName
  RubyReactor.Failure(error)
end

#Halt(reason: nil, **kwargs) ⇒ Object

rubocop:disable Naming/MethodName



38
39
40
41
# File 'lib/ruby_reactor/dsl/template_helpers.rb', line 38

def Halt(reason: nil, **kwargs)
  # rubocop:enable Naming/MethodName
  RubyReactor.Halt(reason: reason, **kwargs)
end

#input(name, path = nil) ⇒ Object



8
9
10
# File 'lib/ruby_reactor/dsl/template_helpers.rb', line 8

def input(name, path = nil)
  RubyReactor::Template::Input.new(name, path)
end

#result(step_name, path = nil) ⇒ Object



12
13
14
# File 'lib/ruby_reactor/dsl/template_helpers.rb', line 12

def result(step_name, path = nil)
  RubyReactor::Template::Result.new(step_name, path)
end

#SkippedObject

rubocop:disable Naming/MethodName



44
45
46
47
# File 'lib/ruby_reactor/dsl/template_helpers.rb', line 44

def Skipped(...)
  # rubocop:enable Naming/MethodName
  RubyReactor.Skipped(...)
end

#Success(value = nil) ⇒ Object

Make Success, Failure, Halt, and Skipped available in DSL contexts rubocop:disable Naming/MethodName



26
27
28
29
# File 'lib/ruby_reactor/dsl/template_helpers.rb', line 26

def Success(value = nil)
  # rubocop:enable Naming/MethodName
  RubyReactor.Success(value)
end

#value(val) ⇒ Object



16
17
18
# File 'lib/ruby_reactor/dsl/template_helpers.rb', line 16

def value(val)
  RubyReactor::Template::Value.new(val)
end