Class: Checkoff::ProjectSelectorEvaluator

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

Overview

Evaluates project selectors against a project

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
PROJECT_FUNCTION_EVALUATORS =

Returns:

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

Returns:

  • (Object)
(COMMON_FUNCTION_EVALUATORS + PROJECT_FUNCTION_EVALUATORS).freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from SelectorEvaluator

#evaluate, #evaluate_args, #try_this_evaluator

Constructor Details

#initialize(project:, projects: Checkoff::Projects.new, custom_fields: Checkoff::CustomFields.new, workspaces: Checkoff::Workspaces.new, portfolios: Checkoff::Portfolios.new) ⇒ Object

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

@param projects

@param custom_fields

@param workspaces

@param portfolios



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/checkoff/internal/project_selector_evaluator.rb', line 16

def initialize(project:,
               projects: Checkoff::Projects.new,
               custom_fields: Checkoff::CustomFields.new,
               workspaces: Checkoff::Workspaces.new,
               portfolios: Checkoff::Portfolios.new)
  @item = project
  @projects = projects
  @custom_fields = custom_fields
  @workspaces = workspaces
  @portfolios = portfolios
  super()
end

Instance Attribute Details

#custom_fieldsCheckoff::CustomFields (readonly)



62
63
64
# File 'lib/checkoff/internal/project_selector_evaluator.rb', line 62

def custom_fields
  @custom_fields
end

#itemAsana::Resources::Project (readonly)

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

Returns:

  • (Asana::Resources::Project)


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

def item
  @item
end

#portfoliosCheckoff::Portfolios (readonly)



66
67
68
# File 'lib/checkoff/internal/project_selector_evaluator.rb', line 66

def portfolios
  @portfolios
end

#projectsCheckoff::Projects (readonly)

Returns:



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

def projects
  @projects
end

#workspacesCheckoff::Workspaces (readonly)



64
65
66
# File 'lib/checkoff/internal/project_selector_evaluator.rb', line 64

def workspaces
  @workspaces
end

Instance Method Details

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



45
46
47
# File 'lib/checkoff/internal/project_selector_evaluator.rb', line 45

def function_evaluators
  FUNCTION_EVALUTORS
end

#initializer_kwargsHash

Returns:

  • (Hash)


50
51
52
53
54
55
# File 'lib/checkoff/internal/project_selector_evaluator.rb', line 50

def initializer_kwargs
  {
    projects:, custom_fields:,
    workspaces:, portfolios:
  }
end