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
-
#object ⇒ Object
(also: #o)
readonly
Returns the value of attribute object.
Instance Method Summary collapse
- #encode ⇒ Object
-
#initialize(object) ⇒ Base
constructor
object should be something similar to an ActiveModel::Serializer or ActiveRecord object.
- #type ⇒ Object
Constructor Details
#initialize(object) ⇒ 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(object) @object = object end |
Instance Attribute Details
#object ⇒ Object (readonly) Also known as: o
Returns the value of attribute object.
14 15 16 |
# File 'lib/magic_pipe/codecs/base.rb', line 14 def object @object end |
Instance Method Details
#encode ⇒ Object
17 18 19 |
# File 'lib/magic_pipe/codecs/base.rb', line 17 def encode raise NotImplementedError end |
#type ⇒ Object
21 22 23 |
# File 'lib/magic_pipe/codecs/base.rb', line 21 def type self.class.const_get(:TYPE) end |