Class: Mongo::Error::Parser
- Inherits:
-
Object
- Object
- Mongo::Error::Parser
- Defined in:
- lib/mongo/error/parser.rb
Overview
Class for parsing the various forms that errors can come in from MongoDB command responses.
Instance Attribute Summary collapse
-
#document ⇒ BSON::Document
readonly
Document The returned document.
-
#message ⇒ String
readonly
Message The error message parsed from the document.
Instance Method Summary collapse
-
#initialize(document) ⇒ Parser
constructor
Create the new parser with the returned document.
Constructor Details
#initialize(document) ⇒ Parser
Create the new parser with the returned document.
38 39 40 41 |
# File 'lib/mongo/error/parser.rb', line 38 def initialize(document) @document = document || {} parse! end |
Instance Attribute Details
#document ⇒ BSON::Document (readonly)
Returns document The returned document.
25 26 27 |
# File 'lib/mongo/error/parser.rb', line 25 def document @document end |
#message ⇒ String (readonly)
Returns message The error message parsed from the document.
28 29 30 |
# File 'lib/mongo/error/parser.rb', line 28 def end |