Module: Mayak::Codec

Extended by:
T::Generic, T::Helpers, T::Sig
Included in:
FromPair, JsonCodec, JsonCodec::FromHashSerializable
Defined in:
lib/mayak/codec.rb

Defined Under Namespace

Classes: FromPair

Constant Summary collapse

Entity =
type_member
Protocol =
type_member

Instance Method Summary collapse

Instance Method Details

#decode(response) ⇒ Object



24
25
# File 'lib/mayak/codec.rb', line 24

def decode(response)
end

#encode(entity) ⇒ Object



16
17
# File 'lib/mayak/codec.rb', line 16

def encode(entity)
end

#to_decoderObject



35
36
37
38
39
# File 'lib/mayak/codec.rb', line 35

def to_decoder
  ::Mayak::Decoder::Implementation[Protocol, Entity].new do |protocol|
    decode(protocol)
  end
end

#to_encoderObject



28
29
30
31
32
# File 'lib/mayak/codec.rb', line 28

def to_encoder
  ::Mayak::Encoder::Implementation[Entity, Protocol].new do |entity|
    encode(entity)
  end
end