Module: Sensu::Settings::Validators::Transport

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

Instance Method Summary collapse

Instance Method Details

#validate_transport(transport) ⇒ Object

Validate a Sensu transport definition. Validates: name

Parameters:

  • transport (Hash)

    sensu transport definition.


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

def validate_transport(transport)
  if is_a_hash?(transport)
    must_be_a_string_if_set(transport[:name]) ||
      invalid(transport, "transport name must be a string")
  else
    invalid(transport, "transport must be a hash")
  end
end