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.
37 38 39 |
# File 'lib/gruf/serializers/errors/json.rb', line 37 def deserialize JSON.parse(@error) end |
#serialize ⇒ String
Returns The serialized JSON string.
30 31 32 |
# File 'lib/gruf/serializers/errors/json.rb', line 30 def serialize @error.to_h.to_json end |