Sha256: 53410d2b0b16874e40b291717edd36053f4571d1c31a8290b919128743ee7fe8

Contents?: true

Size: 860 Bytes

Versions: 36

Compression:

Stored size: 860 Bytes

Contents

# frozen_string_literal: true

require 'checkoff/internal/logging'

module Checkoff
  module SelectorClasses
    # Base class to evaluate types of selector functions
    class FunctionEvaluator
      include Logging

      # @sg-ignore
      # @param _index [Integer]
      def evaluate_arg?(_index)
        true
      end

      # @sg-ignore
      # @return [Boolean]
      def matches?
        raise 'Override me!'
      end

      # @param _task [Asana::Resources::Task]
      # @param _args [Array<Object>]
      # @return [Object]
      # @sg-ignore
      def evaluate(_task, *_args)
        raise 'Implement me!'
      end

      private

      # @param object [Object]
      # @param fn_name [Symbol]
      def fn?(object, fn_name)
        object.is_a?(Array) && !object.empty? && [fn_name, fn_name.to_s].include?(object[0])
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
checkoff-0.201.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.200.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.199.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.198.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.197.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.196.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.195.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.194.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.193.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.192.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.191.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.190.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.189.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.188.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.187.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.186.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.185.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.184.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.183.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.182.0 lib/checkoff/internal/selector_classes/function_evaluator.rb