Class: Gruf::Serializers::Errors::Base
- Inherits:
-
Object
- Object
- Gruf::Serializers::Errors::Base
- Defined in:
- lib/gruf/serializers/errors/base.rb
Overview
Base class for serialization of errors for transport across the grpc protocol
Direct Known Subclasses
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
Instance Method Summary collapse
-
#deserialize ⇒ Object|Hash
Must be implemented in a derived class.
-
#initialize(err) ⇒ Base
constructor
A new instance of Base.
-
#serialize ⇒ String
Must be implemented in a derived class.
Constructor Details
#initialize(err) ⇒ Base
Returns a new instance of Base.
32 33 34 |
# File 'lib/gruf/serializers/errors/base.rb', line 32 def initialize(err) @error = err end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
27 28 29 |
# File 'lib/gruf/serializers/errors/base.rb', line 27 def error @error end |
Instance Method Details
#deserialize ⇒ Object|Hash
Must be implemented in a derived class. This method should deserialize the error object that is transported over the gRPC trailing metadata payload.
52 53 54 |
# File 'lib/gruf/serializers/errors/base.rb', line 52 def deserialize raise NotImplementedError end |
#serialize ⇒ String
Must be implemented in a derived class. This method should serialize the error into a transportable String that can be pushed into GRPC metadata across the wire.
42 43 44 |
# File 'lib/gruf/serializers/errors/base.rb', line 42 def serialize raise NotImplementedError end |