Class: Checkoff::SelectorClasses::Common::CustomFieldGidValueContainsAllGidsPFunctionEvaluator

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

Overview

:custom_field_gid_value_contains_all_gids? function

Constant Summary collapse

FUNCTION_NAME =
:custom_field_gid_value_contains_all_gids?

Instance Method Summary collapse

Methods inherited from FunctionEvaluator

#initialize

Methods included from Logging

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

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)


203
204
205
206
207
208
209
210
211
# File 'lib/checkoff/internal/selector_classes/common.rb', line 203

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)

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

#evaluate_arg?(_index) ⇒ Boolean

Returns:

  • (Boolean)


195
196
197
# File 'lib/checkoff/internal/selector_classes/common.rb', line 195

def evaluate_arg?(_index)
  false
end

#matches?Boolean

Returns:

  • (Boolean)


191
192
193
# File 'lib/checkoff/internal/selector_classes/common.rb', line 191

def matches?
  fn?(selector, FUNCTION_NAME)
end