Sha256: 5d7652238da9222e8b51747ab508ab86739d5fa73ead7ab2ed96aa7e1729213c

Contents?: true

Size: 1012 Bytes

Versions: 31

Compression:

Stored size: 1012 Bytes

Contents

# frozen_string_literal: true

require_relative 'project/function_evaluator'

module Checkoff
  module SelectorClasses
    # Project selector classes
    module Project
      # :due_date function
      class DueDateFunctionEvaluator < FunctionEvaluator
        FUNCTION_NAME = :due_date

        def matches?
          fn?(selector, FUNCTION_NAME)
        end

        # @param resource [Asana::Resources::Project]
        # @return [String, nil]
        def evaluate(resource)
          resource.due_date
        end
      end

      # :ready? function
      class ReadyPFunctionEvaluator < FunctionEvaluator
        FUNCTION_NAME = :ready?

        def matches?
          fn?(selector, FUNCTION_NAME)
        end

        # @param project [Asana::Resources::Project]
        # @param period [Symbol<:now_or_before,:this_week>]
        # @return [Boolean]
        def evaluate(project, period = :now_or_before)
          @projects.project_ready?(project, period: period)
        end
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
checkoff-0.165.0 lib/checkoff/internal/selector_classes/project.rb
checkoff-0.164.0 lib/checkoff/internal/selector_classes/project.rb
checkoff-0.163.0 lib/checkoff/internal/selector_classes/project.rb
checkoff-0.162.0 lib/checkoff/internal/selector_classes/project.rb
checkoff-0.161.0 lib/checkoff/internal/selector_classes/project.rb
checkoff-0.160.0 lib/checkoff/internal/selector_classes/project.rb
checkoff-0.159.0 lib/checkoff/internal/selector_classes/project.rb
checkoff-0.158.0 lib/checkoff/internal/selector_classes/project.rb
checkoff-0.157.0 lib/checkoff/internal/selector_classes/project.rb
checkoff-0.156.0 lib/checkoff/internal/selector_classes/project.rb
checkoff-0.155.0 lib/checkoff/internal/selector_classes/project.rb
checkoff-0.154.0 lib/checkoff/internal/selector_classes/project.rb
checkoff-0.153.0 lib/checkoff/internal/selector_classes/project.rb
checkoff-0.152.0 lib/checkoff/internal/selector_classes/project.rb
checkoff-0.151.0 lib/checkoff/internal/selector_classes/project.rb
checkoff-0.150.0 lib/checkoff/internal/selector_classes/project.rb
checkoff-0.149.0 lib/checkoff/internal/selector_classes/project.rb
checkoff-0.148.0 lib/checkoff/internal/selector_classes/project.rb
checkoff-0.147.0 lib/checkoff/internal/selector_classes/project.rb
checkoff-0.145.0 lib/checkoff/internal/selector_classes/project.rb