Class: Checkoff::SelectorClasses::Common::CustomFieldGidValueContainsAnyGidPFunctionEvaluator

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

Overview

:custom_field_gid_value_contains_any_gid? function

Constant Summary collapse

FUNCTION_NAME =
:custom_field_gid_value_contains_any_gid?

Instance Method Summary collapse

Methods inherited from FunctionEvaluator

#initialize

Constructor Details

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

Instance Method Details

#evaluate(resource, custom_field_gid, custom_field_values_gids) ⇒ Boolean

Parameters:

  • resource (Asana::Resources::Task, Asana::Resources::Project)
  • custom_field_gid (String)
  • custom_field_values_gids (Array<String>)

Returns:

  • (Boolean)


151
152
153
154
155
156
157
158
# File 'lib/checkoff/internal/selector_classes/common.rb', line 151

def evaluate(resource, custom_field_gid, custom_field_values_gids)
  actual_custom_field_values_gids = @custom_fields.resource_custom_field_values_gids_or_raise(resource,
                                                                                              custom_field_gid)

  actual_custom_field_values_gids.any? do |custom_field_value|
    custom_field_values_gids.include?(custom_field_value)
  end
end

#evaluate_arg?(_index) ⇒ Boolean

Returns:

  • (Boolean)


143
144
145
# File 'lib/checkoff/internal/selector_classes/common.rb', line 143

def evaluate_arg?(_index)
  false
end

#matches?Boolean

Returns:

  • (Boolean)


139
140
141
# File 'lib/checkoff/internal/selector_classes/common.rb', line 139

def matches?
  fn?(selector, FUNCTION_NAME)
end