Method: Wavefront::Validators#wf_user_id?

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

#wf_user_id?(user) ⇒ Boolean

Ensure the given argument is a valid user.

Parameters:

  • user (String)

    user identifier

Returns:

  • (Boolean)

    true if valid

Raises:

  • Wavefront::Exceptions::InvalidUserId if not valid



407
408
409
410
411
# File 'lib/wavefront-sdk/validators.rb', line 407

def wf_user_id?(user)
  return true if user.is_a?(String) && user.length < 256 && !user.empty?

  raise Wavefront::Exception::InvalidUserId, user
end