Class: Attr::Gather::Workflow::Task Private

Inherits:
Object
  • Object
show all
Defined in:
lib/attr/gather/workflow/task.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, depends_on: []) ⇒ Task

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Initialize a new DeepMerge aggregator

Parameters:

  • name (String)

    name of the task

  • depends_on (Array<Task>) (defaults to: [])

    tasks needed before running this task



20
21
22
23
# File 'lib/attr/gather/workflow/task.rb', line 20

def initialize(name:, depends_on: [])
  @name = name
  @depends_on = depends_on
end

Instance Attribute Details

#depends_onObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



12
13
14
# File 'lib/attr/gather/workflow/task.rb', line 12

def depends_on
  @depends_on
end

#nameObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



12
13
14
# File 'lib/attr/gather/workflow/task.rb', line 12

def name
  @name
end

Instance Method Details

#as_jsonObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



36
37
38
# File 'lib/attr/gather/workflow/task.rb', line 36

def as_json
  { name: name, depends_on: depends_on }
end

#depends_on?(other_task) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Check if this task depends on a given task

Parameters:

  • other_task (Task)

    task to check

Returns:

  • (Boolean)


28
29
30
# File 'lib/attr/gather/workflow/task.rb', line 28

def depends_on?(other_task)
  depends_on.include?(other_task)
end

#fullfilled_given_remaining_tasks?(task_list) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


32
33
34
# File 'lib/attr/gather/workflow/task.rb', line 32

def fullfilled_given_remaining_tasks?(task_list)
  task_list.none? { |list_task| depends_on?(list_task) }
end