Method: Mongo::Database#==

Defined in:
lib/mongo/database.rb

#==(other) ⇒ true, false

Check equality of the database object against another. Will simply check if the names are the same.

Examples:

Check database equality.

database == other

Parameters:

  • other (Object)

    The object to check against.

Returns:

  • (true, false)

    If the objects are equal.

Since:

  • 2.0.0



94
95
96
97
# File 'lib/mongo/database.rb', line 94

def ==(other)
  return false unless other.is_a?(Database)
  name == other.name
end