Class: Checkoff::SelectorClasses::Task::InSectionNamedPFunctionEvaluator

Inherits:
FunctionEvaluator show all
Defined in:
lib/checkoff/internal/selector_classes/task.rb

Overview

:in_section_named? function

Instance Method Summary collapse

Methods inherited from FunctionEvaluator

#initialize

Methods included from Logging

#debug, #error, #finer, #info, #logger, #warn

Constructor Details

This class inherits a constructor from Checkoff::SelectorClasses::Task::FunctionEvaluator

Instance Method Details

#evaluate(task, section_name) ⇒ Boolean

@sg-ignore

Parameters:

  • task (Asana::Resources::Task)
  • section_name (String)

Returns:

  • (Boolean)


73
74
75
76
77
78
# File 'lib/checkoff/internal/selector_classes/task.rb', line 73

def evaluate(task, section_name)
  task_data = @tasks.task_to_h(task)
  task_data.fetch('unwrapped').fetch('membership_by_section_name').keys.any? do |actual_section_name|
    actual_section_name == section_name
  end
end

#evaluate_arg?(_index) ⇒ Boolean

Parameters:

  • _index (Integer)

Returns:

  • (Boolean)


65
66
67
# File 'lib/checkoff/internal/selector_classes/task.rb', line 65

def evaluate_arg?(_index)
  false
end

#matches?Boolean

Returns:

  • (Boolean)


60
61
62
# File 'lib/checkoff/internal/selector_classes/task.rb', line 60

def matches?
  fn?(selector, :in_section_named?)
end