Class: Roast::SystemCog::Params

Inherits:
Object
  • Object
show all
Defined in:
lib/roast/system_cog/params.rb

Overview

Parameters for system cogs set at workflow evaluation time

Params are used to provide limited evaluation-time parameterization to system cogs, such as the name of the execute scope to be invoked by a ‘call`, `map`, a, `repeat` cog.

System cogs also accept input at execution time, just like regular cogs.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Params

Initialize parameters with the cog name

Subclasses should define their own ‘initialize` accepting specific parameters.

: (Symbol?) -> void



25
26
27
28
# File 'lib/roast/system_cog/params.rb', line 25

def initialize(name)
  @anonymous = name.nil? #: bool
  @name = name || Cog.generate_fallback_name
end

Instance Attribute Details

#nameObject (readonly)

The name identifier for this system cog instance

Used to reference this cog’s output. Auto-generated if not provided.

: Symbol



18
19
20
# File 'lib/roast/system_cog/params.rb', line 18

def name
  @name
end

Instance Method Details

#anonymous?Boolean

Whether the cog is using a fallback name, or was given one explicitly.

: () -> bool

Returns:

  • (Boolean)


33
34
35
# File 'lib/roast/system_cog/params.rb', line 33

def anonymous?
  @anonymous
end