Method: Mongo::Auth::User#spec

Defined in:
lib/mongo/auth/user.rb

#specHash

Get the specification for the user, used in creation.

Examples:

Get the user’s specification.

user.spec

Returns:

  • (Hash)

    The user spec.

Since:

  • 2.0.0



200
201
202
203
204
205
206
# File 'lib/mongo/auth/user.rb', line 200

def spec
  {roles: roles}.tap do |spec|
    if password
      spec[:pwd] = password
    end
  end
end