Sha256: 53410d2b0b16874e40b291717edd36053f4571d1c31a8290b919128743ee7fe8

Contents?: true

Size: 860 Bytes

Versions: 56

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

56 entries across 56 versions & 1 rubygems

Version Path
checkoff-0.222.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.221.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.220.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.219.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.218.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.217.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.216.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.215.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.214.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.213.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.212.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.211.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.210.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.209.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.208.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.207.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.206.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.205.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.204.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.203.0 lib/checkoff/internal/selector_classes/function_evaluator.rb