Class: Checkoff::SelectorClasses::Common::OrFunctionEvaluator

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

Overview

:or function

Does not yet shortcut, but may in future - be careful with side effects!

Constant Summary collapse

FUNCTION_NAME =
:or

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::Common::FunctionEvaluator

Instance Method Details

#evaluate(_resource, lhs, rhs) ⇒ Object

Parameters:

  • _resource (Asana::Resources::Task, Asana::Resources::Project)
  • lhs (Object)
  • rhs (Object)

Returns:

  • (Object)


39
40
41
# File 'lib/checkoff/internal/selector_classes/common.rb', line 39

def evaluate(_resource, lhs, rhs)
  lhs || rhs
end

#matches?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/checkoff/internal/selector_classes/common.rb', line 31

def matches?
  fn?(selector, FUNCTION_NAME)
end