Sha256: c5c429b7aec2a40f998afcbd1c8198ced3f6d9c006727a77c22ccb1e03d8d2c1

Contents?: true

Size: 800 Bytes

Versions: 92

Compression:

Stored size: 800 Bytes

Contents

# frozen_string_literal: true

module Checkoff
  module SelectorClasses
    # Base class to evaluate types of selector functions
    class FunctionEvaluator
      # @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

92 entries across 92 versions & 1 rubygems

Version Path
checkoff-0.67.1 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.67.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.66.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.65.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.64.1 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.64.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.63.1 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.63.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.62.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.61.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.60.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.59.0 lib/checkoff/internal/selector_classes/function_evaluator.rb