Class: MagicPipe::Codecs::Base
- Inherits:
-
Object
- Object
- MagicPipe::Codecs::Base
- Defined in:
- lib/magic_pipe/codecs/base.rb
Constant Summary collapse
- TYPE =
"none"
Instance Attribute Summary collapse
-
#envelope ⇒ Object
(also: #object, #o)
readonly
Returns the value of attribute envelope.
Instance Method Summary collapse
- #encode ⇒ Object
-
#initialize(envelope) ⇒ Base
constructor
object should be something similar to an ActiveModel::Serializer or ActiveRecord object.
- #inner_object ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(envelope) ⇒ Base
object should be something similar to an ActiveModel::Serializer or ActiveRecord object.
10 11 12 |
# File 'lib/magic_pipe/codecs/base.rb', line 10 def initialize(envelope) @envelope = envelope end |
Instance Attribute Details
#envelope ⇒ Object (readonly) Also known as: object, o
Returns the value of attribute envelope.
14 15 16 |
# File 'lib/magic_pipe/codecs/base.rb', line 14 def envelope @envelope end |
Instance Method Details
#encode ⇒ Object
18 19 20 |
# File 'lib/magic_pipe/codecs/base.rb', line 18 def encode raise NotImplementedError end |
#inner_object ⇒ Object
22 23 24 |
# File 'lib/magic_pipe/codecs/base.rb', line 22 def inner_object @envelope.body end |
#type ⇒ Object
26 27 28 |
# File 'lib/magic_pipe/codecs/base.rb', line 26 def type self.class.const_get(:TYPE) end |