Class: Checkoff::SelectorClasses::Common::CustomFieldValueFunctionEvaluator

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

Overview

:custom_field_value function

Constant Summary collapse

FUNCTION_NAME =

Returns:

  • (Object)
:custom_field_value

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, custom_field_name) ⇒ String?

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 @param resource

@param custom_field_name

Parameters:

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

Returns:

  • (String, nil)


107
108
109
110
111
112
113
114
115
# File 'lib/checkoff/internal/selector_classes/common.rb', line 107

def evaluate(resource, custom_field_name)
  # @sg-ignore
  custom_field = @custom_fields.resource_custom_field_by_name(resource, custom_field_name)
  # @sg-ignore
  return nil if custom_field.nil?

  # @sg-ignore
  custom_field['display_value']
end

#evaluate_arg?(_index) ⇒ Boolean

@param _index

Parameters:

  • _index (Integer)

Returns:

  • (Boolean)


100
101
102
# File 'lib/checkoff/internal/selector_classes/common.rb', line 100

def evaluate_arg?(_index)
  false
end

#matches?Boolean

Returns:

  • (Boolean)


95
96
97
# File 'lib/checkoff/internal/selector_classes/common.rb', line 95

def matches?
  fn?(selector, FUNCTION_NAME)
end