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

#selector

Instance Method Summary collapse

Methods inherited from FunctionEvaluator

#initialize

Methods inherited from FunctionEvaluator

#debug, #error, #evaluate_arg?, #finer, #fn?, #info, #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 @sg-ignore

@sg-ignore

@param project

@param portfolio_name

@param workspace_name

@param extra_project_fields



60
61
62
63
64
65
66
67
68
69
# File 'lib/checkoff/internal/selector_classes/project.rb', line 60

def evaluate(project, portfolio_name, workspace_name: nil, extra_project_fields: [])
  workspace_name ||= project.workspace&.name
  # @sg-ignore
  workspace_name ||= @workspaces.default_workspace.name
  # @sg-ignore
  projects = @portfolios.projects_in_portfolio(workspace_name, portfolio_name,
                                               extra_project_fields:)
  # @sg-ignore
  projects.any? { |p| p.name == project.name }
end

#matches?Boolean

Returns:

  • (Boolean)


48
49
50
# File 'lib/checkoff/internal/selector_classes/project.rb', line 48

def matches?
  fn?(selector, FUNCTION_NAME)
end