Class: Roast::SystemCog
- Defined in:
- lib/roast/system_cog.rb,
lib/roast/system_cog/params.rb
Direct Known Subclasses
Roast::SystemCogs::Call, Roast::SystemCogs::Map, Roast::SystemCogs::Repeat
Defined Under Namespace
Classes: Params
Instance Attribute Summary
Attributes inherited from Cog
Class Method Summary collapse
-
.params_class ⇒ Object
: () -> singleton(SystemCog::Params).
Instance Method Summary collapse
-
#execute(input) ⇒ Object
: (Cog::Input) -> Cog::Output.
-
#initialize(name, cog_input_proc, anonymous:, &on_execute) ⇒ SystemCog
constructor
: (Symbol, ^(Cog::Input) -> untyped, anonymous: bool) { (Cog::Input, Cog::Config) -> Cog::Output } -> void.
Methods inherited from Cog
#anonymous?, config_class, #failed?, generate_fallback_name, input_class, #run!, #skipped?, #started?, #stopped?, #succeeded?, #type, #wait
Constructor Details
#initialize(name, cog_input_proc, anonymous:, &on_execute) ⇒ SystemCog
: (Symbol, ^(Cog::Input) -> untyped, anonymous: bool) { (Cog::Input, Cog::Config) -> Cog::Output } -> void
22 23 24 25 |
# File 'lib/roast/system_cog.rb', line 22 def initialize(name, cog_input_proc, anonymous:, &on_execute) super(name, cog_input_proc, anonymous:) @on_execute = on_execute end |
Class Method Details
.params_class ⇒ Object
: () -> singleton(SystemCog::Params)
8 9 10 |
# File 'lib/roast/system_cog.rb', line 8 def params_class @params_class ||= find_child_params_or_default end |
Instance Method Details
#execute(input) ⇒ Object
: (Cog::Input) -> Cog::Output
28 29 30 31 32 |
# File 'lib/roast/system_cog.rb', line 28 def execute(input) # The `on_execute` callback allows a system cog to pass its execution back to the ExecutionManager # for special handling. @on_execute.call(input, @config) end |