Class: Mongo::DBRef
Overview
A reference to another object in a MongoDB database.
Instance Attribute Summary collapse
-
#namespace ⇒ Object
readonly
Returns the value of attribute namespace.
-
#object_id ⇒ Object
readonly
Returns the value of attribute object_id.
Instance Method Summary collapse
-
#initialize(namespace, object_id) ⇒ DBRef
constructor
Create a DBRef.
- #to_s ⇒ Object
Constructor Details
#initialize(namespace, object_id) ⇒ DBRef
Create a DBRef. Use this class in conjunction with DB#dereference.
30 31 32 33 |
# File 'lib/mongo/types/dbref.rb', line 30 def initialize(namespace, object_id) @namespace = namespace @object_id = object_id end |
Instance Attribute Details
#namespace ⇒ Object (readonly)
Returns the value of attribute namespace.
22 23 24 |
# File 'lib/mongo/types/dbref.rb', line 22 def namespace @namespace end |
#object_id ⇒ Object (readonly)
Returns the value of attribute object_id.
22 23 24 |
# File 'lib/mongo/types/dbref.rb', line 22 def object_id @object_id end |
Instance Method Details
#to_s ⇒ Object
35 36 37 |
# File 'lib/mongo/types/dbref.rb', line 35 def to_s "ns: #{namespace}, id: #{object_id}" end |