lib/jss/api_object/criteriable/criteria.rb
###
### Chech the validity of a criterion.
### Note that this doesn't check the :priority
### which is set by methods calling this one.
###
### Return true or raise an error about the problem
###
Chech the validity of a criterion.
Note that this doesn't check the :priority
which is set by methods calling this one.

Return true or raise an error about the problem
Chech the validity of a criterion . Note that this doesn ' t check the : priority which is set by methods calling this one . Return true or raise an error about the problem
def criterion_ok?(criterion)
        raise JSS::InvalidDataError, "Duplicate criterion: #{criterion.signature}" if @criteria.select { |c| c == criterion }.count > 1
        raise JSS::InvalidDataError, "Missing :and_or for criterion: #{criterion.signature}" unless criterion.and_or
        raise JSS::InvalidDataError, "Missing :name for criterion: #{criterion.signature}" unless criterion.name
        raise JSS::InvalidDataError, "Missing :search_type for criterion: #{criterion.signature}" unless criterion.search_type
        raise JSS::InvalidDataError, "Missing :value for criterion: #{criterion.signature}" unless criterion.value
        true
      end
def criterion_ok? ( criterion ) raise JSS :: InvalidDataError , "Duplicate criterion: #{criterion.signature}" if @criteria . select { | c | c == criterion } . count > 1 raise JSS :: InvalidDataError , "Missing :and_or for criterion: #{criterion.signature}" unless criterion . and_or raise JSS :: InvalidDataError , "Missing :name for criterion: #{criterion.signature}" unless criterion . name raise JSS :: InvalidDataError , "Missing :search_type for criterion: #{criterion.signature}" unless criterion . search_type raise JSS :: InvalidDataError , "Missing :value for criterion: #{criterion.signature}" unless criterion . value true end
Chech the validity of a criterion.
Chech the validity of a criterion .
criterion