Class: MongoBrowser::Models::Document
- Inherits:
-
Object
- Object
- MongoBrowser::Models::Document
- Defined in:
- lib/mongo_browser/models/document.rb
Instance Attribute Summary collapse
-
#collection_name ⇒ Object
readonly
Returns the value of attribute collection_name.
-
#db_name ⇒ Object
readonly
Returns the value of attribute db_name.
-
#mongo_document ⇒ Object
(also: #data)
readonly
Returns the value of attribute mongo_document.
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(db_name, collection_name, mongo_document) ⇒ Document
constructor
A new instance of Document.
Constructor Details
#initialize(db_name, collection_name, mongo_document) ⇒ Document
Returns a new instance of Document.
7 8 9 10 11 12 |
# File 'lib/mongo_browser/models/document.rb', line 7 def initialize(db_name, collection_name, mongo_document) @db_name = db_name @collection_name = collection_name @mongo_document = mongo_document end |
Instance Attribute Details
#collection_name ⇒ Object (readonly)
Returns the value of attribute collection_name.
4 5 6 |
# File 'lib/mongo_browser/models/document.rb', line 4 def collection_name @collection_name end |
#db_name ⇒ Object (readonly)
Returns the value of attribute db_name.
4 5 6 |
# File 'lib/mongo_browser/models/document.rb', line 4 def db_name @db_name end |
#mongo_document ⇒ Object (readonly) Also known as: data
Returns the value of attribute mongo_document.
5 6 7 |
# File 'lib/mongo_browser/models/document.rb', line 5 def mongo_document @mongo_document end |
Instance Method Details
#id ⇒ Object
14 15 16 |
# File 'lib/mongo_browser/models/document.rb', line 14 def id mongo_document["_id"] end |