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

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)


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

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)


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

def evaluate_arg?(_index)
  false
end

#matches?Boolean

Returns:

  • (Boolean)


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

def matches?
  fn?(selector, FUNCTION_NAME)
end