Sha256: 1dd002193bd9d07fe1535c66e6740b752b34799ad9cc75744b4824a09bb44488

Contents?: true

Size: 845 Bytes

Versions: 32

Compression:

Stored size: 845 Bytes

Contents

# frozen_string_literal: true

require_relative 'section/function_evaluator'

module Checkoff
  module SelectorClasses
    # Section selector classes
    module Section
      # :ends_with_milestone function
      class DueDateFunctionEvaluator < FunctionEvaluator
        FUNCTION_NAME = :ends_with_milestone

        def matches?
          fn?(selector, FUNCTION_NAME)
        end

        # @param section [Asana::Resources::Section]
        #
        # @sg-ignore
        # @return [Boolean]
        def evaluate(section)
          tasks = client.tasks.get_tasks(section: section.gid,
                                         per_page: 100,
                                         options: { fields: ['resource_subtype'] })
          # @sg-ignore
          tasks.last&.resource_subtype == 'milestone'
        end
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
checkoff-0.109.0 lib/checkoff/internal/selector_classes/section.rb
checkoff-0.108.0 lib/checkoff/internal/selector_classes/section.rb
checkoff-0.107.0 lib/checkoff/internal/selector_classes/section.rb
checkoff-0.106.0 lib/checkoff/internal/selector_classes/section.rb
checkoff-0.105.0 lib/checkoff/internal/selector_classes/section.rb
checkoff-0.104.0 lib/checkoff/internal/selector_classes/section.rb
checkoff-0.103.0 lib/checkoff/internal/selector_classes/section.rb
checkoff-0.102.0 lib/checkoff/internal/selector_classes/section.rb
checkoff-0.101.0 lib/checkoff/internal/selector_classes/section.rb
checkoff-0.100.0 lib/checkoff/internal/selector_classes/section.rb
checkoff-0.99.0 lib/checkoff/internal/selector_classes/section.rb
checkoff-0.98.0 lib/checkoff/internal/selector_classes/section.rb
checkoff-0.97.0 lib/checkoff/internal/selector_classes/section.rb
checkoff-0.96.0 lib/checkoff/internal/selector_classes/section.rb
checkoff-0.95.0 lib/checkoff/internal/selector_classes/section.rb
checkoff-0.94.0 lib/checkoff/internal/selector_classes/section.rb
checkoff-0.93.0 lib/checkoff/internal/selector_classes/section.rb
checkoff-0.92.0 lib/checkoff/internal/selector_classes/section.rb
checkoff-0.91.0 lib/checkoff/internal/selector_classes/section.rb
checkoff-0.90.0 lib/checkoff/internal/selector_classes/section.rb