Class: Checkoff::SelectorClasses::Section::EndsWithMilestoneFunctionEvaluator

Inherits:
FunctionEvaluator show all
Defined in:
lib/checkoff/internal/selector_classes/section.rb

Overview

:ends_with_milestone function

Constant Summary collapse

FUNCTION_NAME =
:ends_with_milestone

Instance Method Summary collapse

Methods inherited from FunctionEvaluator

#initialize

Methods inherited from FunctionEvaluator

#evaluate_arg?

Constructor Details

This class inherits a constructor from Checkoff::SelectorClasses::Section::FunctionEvaluator

Instance Method Details

#evaluate(section) ⇒ Boolean

@sg-ignore

Parameters:

  • section (Asana::Resources::Section)

Returns:

  • (Boolean)


21
22
23
24
25
26
27
# File 'lib/checkoff/internal/selector_classes/section.rb', line 21

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

#matches?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/checkoff/internal/selector_classes/section.rb', line 13

def matches?
  fn?(selector, FUNCTION_NAME)
end