Class: Checkoff::SelectorClasses::Common::NameStartsWithPFunctionEvaluator

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

Overview

:name_starts_with? function

Constant Summary collapse

FUNCTION_NAME =

Returns:

  • (Object)
:name_starts_with?

Instance Attribute Summary

Attributes inherited from FunctionEvaluator

#selector

Instance Method Summary collapse

Methods inherited from FunctionEvaluator

#initialize

Methods inherited from FunctionEvaluator

#debug, #error, #finer, #fn?, #info, #log_level, #logger, #warn

Methods included from Logging

#debug, #error, #finer, #info, #log_level, #logger, #warn

Constructor Details

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

Instance Method Details

#evaluate(resource, prefix) ⇒ boolish

sord warn - Asana::Resources::Task wasn't able to be resolved to a constant in this project sord warn - Asana::Resources::Project wasn't able to be resolved to a constant in this project sord warn - boolish is probably not a type, but using anyway sord warn - boolish wasn't able to be resolved to a constant in this project @sg-ignore

@param resource

@param prefix

Parameters:

  • resource (Asana::Resources::Task, Asana::Resources::Project)
  • prefix (String)

Returns:

  • (boolish)


248
249
250
# File 'lib/checkoff/internal/selector_classes/common.rb', line 248

def evaluate(resource, prefix)
  resource.name&.start_with?(prefix)
end

#evaluate_arg?(_index) ⇒ Boolean

Parameters:

  • _index (Integer)

Returns:

  • (Boolean)


240
241
242
# File 'lib/checkoff/internal/selector_classes/common.rb', line 240

def evaluate_arg?(_index)
  false
end

#matches?Boolean

Returns:

  • (Boolean)


236
237
238
# File 'lib/checkoff/internal/selector_classes/common.rb', line 236

def matches?
  fn?(selector, FUNCTION_NAME)
end