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.165.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.164.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.163.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.162.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.161.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.160.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.159.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.158.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.157.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.156.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.155.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.154.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.153.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.152.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.151.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.150.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.149.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.148.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.147.0 lib/checkoff/internal/selector_classes/function_evaluator.rb
checkoff-0.145.0 lib/checkoff/internal/selector_classes/function_evaluator.rb