Class: Checkoff::TaskSelectorEvaluator

Inherits:
SelectorEvaluator show all
Defined in:
lib/checkoff/internal/task_selector_evaluator.rb,
sig/checkoff.rbs

Overview

Evaluates task selectors against a task

Constant Summary collapse

COMMON_FUNCTION_EVALUATORS =

Returns:

  • (Object)
(Checkoff::SelectorClasses::Common.constants.map do |const|
  Checkoff::SelectorClasses::Common.const_get(const)
end - [Checkoff::SelectorClasses::Common::FunctionEvaluator]).freeze
TASK_FUNCTION_EVALUATORS =

Returns:

  • (Object)
(Checkoff::SelectorClasses::Task.constants.map do |const|
  Checkoff::SelectorClasses::Task.const_get(const)
end - [Checkoff::SelectorClasses::Task::FunctionEvaluator]).freeze
FUNCTION_EVALUTORS =

Returns:

  • (Object)
(COMMON_FUNCTION_EVALUATORS + TASK_FUNCTION_EVALUATORS).freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from SelectorEvaluator

#evaluate, #evaluate_args, #try_this_evaluator

Constructor Details

#initialize(task:, tasks: Checkoff::Tasks.new, timelines: Checkoff::Timelines.new, custom_fields: Checkoff::CustomFields.new) ⇒ Object

sord warn - Asana::Resources::Task wasn't able to be resolved to a constant in this project @param task

@param tasks

@param timelines

@param custom_fields



15
16
17
18
19
20
21
22
23
24
# File 'lib/checkoff/internal/task_selector_evaluator.rb', line 15

def initialize(task:,
               tasks: Checkoff::Tasks.new,
               timelines: Checkoff::Timelines.new,
               custom_fields: Checkoff::CustomFields.new)
  @item = task
  @tasks = tasks
  @timelines = timelines
  @custom_fields = custom_fields
  super()
end

Instance Attribute Details

#custom_fieldsCheckoff::CustomFields (readonly)



58
59
60
# File 'lib/checkoff/internal/task_selector_evaluator.rb', line 58

def custom_fields
  @custom_fields
end

#itemAsana::Resources::Task (readonly)

sord warn - Asana::Resources::Task wasn't able to be resolved to a constant in this project

Returns:

  • (Asana::Resources::Task)


52
53
54
# File 'lib/checkoff/internal/task_selector_evaluator.rb', line 52

def item
  @item
end

#tasksCheckoff::Tasks (readonly)

Returns:



54
55
56
# File 'lib/checkoff/internal/task_selector_evaluator.rb', line 54

def tasks
  @tasks
end

#timelinesCheckoff::Timelines (readonly)

Returns:



56
57
58
# File 'lib/checkoff/internal/task_selector_evaluator.rb', line 56

def timelines
  @timelines
end

Instance Method Details

#function_evaluatorsArray<Class<Checkoff::SelectorClasses::Task::FunctionEvaluator>>



42
43
44
# File 'lib/checkoff/internal/task_selector_evaluator.rb', line 42

def function_evaluators
  FUNCTION_EVALUTORS
end

#initializer_kwargsHash

Returns:

  • (Hash)


47
48
49
# File 'lib/checkoff/internal/task_selector_evaluator.rb', line 47

def initializer_kwargs
  { tasks:, timelines:, custom_fields: }
end