Sha256: 53a2f2b0fdeb34c468c499da3785740feafd7906b82986a6461b48b6eeed31ee
Contents?: true
Size: 1.33 KB
Versions: 29
Compression:
Stored size: 1.33 KB
Contents
# frozen_string_literal: true require_relative 'selector_classes/common' require_relative 'selector_classes/task' require_relative 'selector_evaluator' module Checkoff # Evaluates task selectors against a task class TaskSelectorEvaluator < SelectorEvaluator # @param task [Asana::Resources::Task] # @param tasks [Checkoff::Tasks] def initialize(task:, tasks: Checkoff::Tasks.new) @item = task @tasks = tasks super() end private COMMON_FUNCTION_EVALUATORS = (Checkoff::SelectorClasses::Common.constants.map do |const| Checkoff::SelectorClasses::Common.const_get(const) end - [Checkoff::SelectorClasses::Common::FunctionEvaluator]).freeze TASK_FUNCTION_EVALUATORS = (Checkoff::SelectorClasses::Task.constants.map do |const| Checkoff::SelectorClasses::Task.const_get(const) end - [Checkoff::SelectorClasses::Task::FunctionEvaluator]).freeze FUNCTION_EVALUTORS = (COMMON_FUNCTION_EVALUATORS + TASK_FUNCTION_EVALUATORS).freeze # @return [Array<Class<TaskSelectorClasses::FunctionEvaluator>>] def function_evaluators FUNCTION_EVALUTORS end # @return [Hash] def initializer_kwargs { tasks: tasks } end # @return [Asana::Resources::Task] attr_reader :item # @return [Checkoff::Tasks] attr_reader :tasks end end
Version data entries
29 entries across 29 versions & 1 rubygems