Method: JSS::Criteriable::Criteria#set_criterion

Defined in:
lib/jss-api/api_object/criteriable/criteria.rb

#set_criterion(priority, criterion) ⇒ void

This method returns an undefined value.

Change the details of one specific criterion

Parameters:

  • priority (Integer)

    the priority/index of the criterion being changed. The index must already exist. Otherwise use #append_criterion, #prepend_criterion, or #insert_criterion

  • criterion (JSS::Criteriable::Criterion)

    the new Criterion to store at that index

Raises:



176
177
178
179
180
181
182
# File 'lib/jss-api/api_object/criteriable/criteria.rb', line 176

def set_criterion(priority, criterion)
  raise JSS::NoSuchItemError, "No current criterion with priority '#{priority}'" unless @criteria[priority]
  criterion_ok? criterion
  @criteria[priority] = criterion
  set_priorities
  @container.should_update if @container
end