Class: Mongo::DBRef

Inherits:
Object
  • Object
show all
Defined in:
lib/mongo/types/dbref.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(namespace, object_id) ⇒ DBRef

Returns a new instance of DBRef.



23
24
25
26
# File 'lib/mongo/types/dbref.rb', line 23

def initialize(namespace, object_id)
  @namespace, @object_id =
    namespace, object_id
end

Instance Attribute Details

#namespaceObject (readonly)

Returns the value of attribute namespace.



21
22
23
# File 'lib/mongo/types/dbref.rb', line 21

def namespace
  @namespace
end

#object_idObject (readonly)

Returns the value of attribute object_id.



21
22
23
# File 'lib/mongo/types/dbref.rb', line 21

def object_id
  @object_id
end

Instance Method Details

#to_sObject



28
29
30
# File 'lib/mongo/types/dbref.rb', line 28

def to_s
  "ns: #{namespace}, id: #{object_id}"
end