mongo-ruby-driver/lib/mongo/dbref.rb

38 lines
1.1 KiB
Ruby
Raw Normal View History

2009-01-08 19:43:30 +00:00
# --
# Copyright (C) 2008-2009 10gen Inc.
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License, version 3, as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
# for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# ++
module XGen
module Mongo
module Driver
class DBRef
attr_reader :parent, :field_name, :db, :namespace, :object_id
def initialize(parent, field_name, db, namespace, object_id)
@parent, @field_name, @db, @namespace, @object_id =
parent, field_name, db, namespace, object_id
end
def to_s
"ns: #{namespace}, id: #{object_id}"
end
end
end
end
end