Class: Checkoff::SelectorClasses::Common::CustomFieldGidValueFunctionEvaluator

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

Overview

:custom_field_gid_value function

Instance Attribute Summary

Attributes inherited from FunctionEvaluator

#custom_fields, #selector

Instance Method Summary collapse

Methods inherited from FunctionEvaluator

#initialize

Methods inherited from FunctionEvaluator

#debug, #error, #finer, #fn?, #info, #initialize, #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_gid) ⇒ 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_gid

Parameters:

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

Returns:

  • (String, nil)


128
129
130
131
132
# File 'lib/checkoff/internal/selector_classes/common.rb', line 128

def evaluate(resource, custom_field_gid)
  custom_field = custom_fields.resource_custom_field_by_gid_or_raise(resource, custom_field_gid)
  display_value = custom_field['display_value']
  display_value.nil? ? nil : T.cast(display_value, String)
end

#evaluate_arg?(_index) ⇒ Boolean

Parameters:

  • _index (Integer)

Returns:

  • (Boolean)


121
122
123
# File 'lib/checkoff/internal/selector_classes/common.rb', line 121

def evaluate_arg?(_index)
  false
end

#matches?Boolean

Returns:

  • (Boolean)


117
118
119
# File 'lib/checkoff/internal/selector_classes/common.rb', line 117

def matches?
  fn?(selector, :custom_field_gid_value)
end