Sha256: 53410d2b0b16874e40b291717edd36053f4571d1c31a8290b919128743ee7fe8

Contents?: true

Size: 860 Bytes

Versions: 40

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

40 entries across 40 versions & 1 rubygems

Version Path
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
checkoff-0.181.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.180.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.179.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.178.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.177.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.176.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.175.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.174.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.173.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.172.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.171.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.170.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.169.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.168.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.167.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.166.0 lib/checkoff/internal/selector_classes/function_evaluator.rb