Class: Herbert::LoggingProviders::MongoProvider
- Inherits:
-
Object
- Object
- Herbert::LoggingProviders::MongoProvider
- Defined in:
- lib/herbert/AppLogger.rb
Overview
Persists log in DB
Constant Summary collapse
- Collection =
'logs'
Instance Method Summary collapse
-
#id ⇒ Boolean
FIXME “Flag” indicating that this provider returns IDs.
-
#initialize(db) ⇒ MongoProvider
constructor
A new instance of MongoProvider.
- #save(log) ⇒ Object
Constructor Details
#initialize(db) ⇒ MongoProvider
Returns a new instance of MongoProvider.
86 87 88 |
# File 'lib/herbert/AppLogger.rb', line 86 def initialize(db) @db = db end |
Instance Method Details
#id ⇒ Boolean
FIXME “Flag” indicating that this provider returns IDs
99 100 101 |
# File 'lib/herbert/AppLogger.rb', line 99 def id true end |
#save(log) ⇒ Object
91 92 93 |
# File 'lib/herbert/AppLogger.rb', line 91 def save(log) @db[Collection].save(log) end |