Class: Checkoff::SelectorClasses::Project::InPortfolioNamedPFunctionEvaluator

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

Overview

:in_portfolio_named? function

Constant Summary collapse

FUNCTION_NAME =

Returns:

  • (Object)
:in_portfolio_named?

Instance Attribute Summary

Attributes inherited from FunctionEvaluator

#portfolios, #projects, #selector, #workspaces

Instance Method Summary collapse

Methods inherited from FunctionEvaluator

#initialize

Methods inherited from FunctionEvaluator

#debug, #error, #evaluate_arg?, #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::Project::FunctionEvaluator

Instance Method Details

#evaluate(project, portfolio_name, workspace_name: nil, extra_project_fields: []) ⇒ Object

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

@param portfolio_name

@param workspace_name

@param extra_project_fields



56
57
58
59
60
61
62
# File 'lib/checkoff/internal/selector_classes/project.rb', line 56

def evaluate(project, portfolio_name, workspace_name: nil, extra_project_fields: [])
  workspace_name ||= project.workspace&.name
  workspace_name ||= workspaces.default_workspace.name
  matching_projects = portfolios.projects_in_portfolio(T.must(workspace_name), portfolio_name,
                                                       extra_project_fields:)
  matching_projects.any? { |p| p.name == project.name }
end

#matches?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/checkoff/internal/selector_classes/project.rb', line 46

def matches?
  fn?(selector, FUNCTION_NAME)
end