Class: Mongrep::MongoModel Abstract
- Inherits:
-
Object
- Object
- Mongrep::MongoModel
- Includes:
- Abstractize, Model
- Defined in:
- lib/mongrep/mongo_model.rb
Overview
This class is abstract.
The base class for all models
Instance Method Summary collapse
-
#bson_type ⇒ Object
private
Used by Mongo to convert the model into BSON.
-
#id ⇒ Object
An alias for #_id.
-
#to_bson(*args) ⇒ Object
private
Used by Mongo to convert the model into BSON.
Methods included from Model
Methods included from Mongrep::Model::VirtusExtensions
Instance Method Details
#bson_type ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Used by Mongo to convert the model into BSON
22 23 24 |
# File 'lib/mongrep/mongo_model.rb', line 22 def bson_type Hash::BSON_TYPE end |
#id ⇒ Object
An alias for #_id
16 17 18 |
# File 'lib/mongrep/mongo_model.rb', line 16 def id _id end |
#to_bson(*args) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Used by Mongo to convert the model into BSON
28 29 30 |
# File 'lib/mongrep/mongo_model.rb', line 28 def to_bson(*args) to_h.to_bson(*args) end |