Class: Checkoff::SelectorClasses::Task::InProjectNamedPFunctionEvaluator

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

Overview

:in_project_named? function

Instance Attribute Summary

Attributes inherited from FunctionEvaluator

#custom_fields, #selector, #tasks, #timelines

Instance Method Summary collapse

Methods inherited from FunctionEvaluator

#initialize

Methods inherited from FunctionEvaluator

#debug, #error, #finer, #fn?, #info, #initialize, #log_level, #logger, #warn

Methods included from Logging

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

Constructor Details

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

Instance Method Details

#evaluate(task, project_name) ⇒ Boolean

sord warn - Asana::Resources::Task wasn't able to be resolved to a constant in this project @sg-ignore Hash#fetch generic leak on rbs >= 4.1.0, fix in progress upstream https://github.com/castwide/solargraph/pull/1228

@param task

@param project_name

Parameters:

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

Returns:

  • (Boolean)


114
115
116
117
118
119
120
121
# File 'lib/checkoff/internal/selector_classes/task.rb', line 114

def evaluate(task, project_name)
  project_names = task.memberships.map do |membership|
    # @sg-ignore Hash#fetch generic<X> leak on rbs >= 4.1.0, fix in progress upstream
    # https://github.com/castwide/solargraph/pull/1228
    membership.fetch('project').fetch('name')
  end
  project_names.include?(project_name)
end

#evaluate_arg?(_index) ⇒ Boolean

@param _index

Parameters:

  • _index (Integer)

Returns:

  • (Boolean)


105
106
107
# File 'lib/checkoff/internal/selector_classes/task.rb', line 105

def evaluate_arg?(_index)
  false
end

#matches?Boolean

Returns:

  • (Boolean)


100
101
102
# File 'lib/checkoff/internal/selector_classes/task.rb', line 100

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