Class: Gruf::Serializers::Errors::Json
- Defined in:
- lib/gruf/serializers/errors/json.rb
Overview
Serializes the error via JSON for transport
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#deserialize ⇒ Hash
A hash deserialized from the inputted JSON.
-
#serialize ⇒ String
The serialized JSON string.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Gruf::Serializers::Errors::Base
Instance Method Details
#deserialize ⇒ Hash
Returns A hash deserialized from the inputted JSON.
35 36 37 |
# File 'lib/gruf/serializers/errors/json.rb', line 35 def deserialize JSON.parse(@error) end |
#serialize ⇒ String
Returns The serialized JSON string.
28 29 30 |
# File 'lib/gruf/serializers/errors/json.rb', line 28 def serialize @error.to_h.to_json end |