Class: RCrewAI::Flow::Trigger

Inherits:
Struct
  • Object
show all
Defined in:
lib/rcrewai/flow.rb

Overview

--- Trigger descriptors -------------------------------------------------

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#modeObject

Returns the value of attribute mode

Returns:

  • (Object)

    the current value of mode



31
32
33
# File 'lib/rcrewai/flow.rb', line 31

def mode
  @mode
end

#namesObject

Returns the value of attribute names

Returns:

  • (Object)

    the current value of names



31
32
33
# File 'lib/rcrewai/flow.rb', line 31

def names
  @names
end

Instance Method Details

#satisfied_by?(completed) ⇒ Boolean

Returns:

  • (Boolean)


32
33
34
35
36
37
# File 'lib/rcrewai/flow.rb', line 32

def satisfied_by?(completed)
  case mode
  when :single, :or then names.any? { |n| completed.include?(n) }
  when :and then names.all? { |n| completed.include?(n) }
  end
end