Module: Sensu::Settings::Validators::Tessen

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

Instance Method Summary collapse

Instance Method Details

#validate_tessen(tessen) ⇒ Object

Validate a Tessen definition. Validates: enabled, identity_key

Parameters:

  • tessen (Hash)

    tessen definition.


9
10
11
12
13
14
15
16
17
18
# File 'lib/sensu/settings/validators/tessen.rb', line 9

def validate_tessen(tessen)
  must_be_a_hash_if_set(tessen) ||
    invalid(tessen, "tessen must be a hash")
  if is_a_hash?(tessen)
    must_be_boolean_if_set(tessen[:enabled]) ||
      invalid(tessen, "tessen enabled must be boolean")
    must_be_a_string_if_set(tessen[:identity_key]) ||
      invalid(tessen, "tessen identity_key must be a string")
  end
end