Method: Wavefront::Validators#wf_message_id?

Defined in:
lib/wavefront-sdk/validators.rb

#wf_message_id?(id) ⇒ Boolean

Ensure the given argument is a valid message ID

Parameters:

Returns:

  • (Boolean)

    true if valid

Raises:

  • Wavefront::Exceptions::InvalidMessageId if not valid



339
340
341
342
343
# File 'lib/wavefront-sdk/validators.rb', line 339

def wf_message_id?(id)
  return true if id.is_a?(String) && id =~ /^\w+::\w+$/

  raise Wavefront::Exception::InvalidMessageId, id
end