Module: Sensu::Settings::Validators::Filter

Included in:
Sensu::Settings::Validators
Defined in:
lib/sensu/settings/validators/filter.rb

Instance Method Summary collapse

Instance Method Details

#validate_filter(filter) ⇒ Object

Validate a Sensu filter definition. Validates: attributes, negate

Parameters:

  • filter (Hash)

    sensu filter definition.


9
10
11
12
13
14
# File 'lib/sensu/settings/validators/filter.rb', line 9

def validate_filter(filter)
  must_be_boolean_if_set(filter[:negate]) ||
    invalid(filter, "filter negate must be boolean")
  must_be_a_hash(filter[:attributes]) ||
    invalid(filter, "filter attributes must be a hash")
end