Class: XGen::Mongo::Driver::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.



25
26
27
28
# File 'lib/mongo/types/dbref.rb', line 25

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

Instance Attribute Details

#namespaceObject (readonly)

Returns the value of attribute namespace.



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

def namespace
  @namespace
end

#object_idObject (readonly)

Returns the value of attribute object_id.



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

def object_id
  @object_id
end

Instance Method Details

#to_sObject



30
31
32
# File 'lib/mongo/types/dbref.rb', line 30

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