Module: Mayak::Encoder

Extended by:
T::Generic, T::Helpers, T::Sig
Included in:
FromFunction, Http::Encoder, Json::Encoder, Json::Encoder::FromFunction
Defined in:
lib/mayak/encoder.rb

Defined Under Namespace

Classes: FromFunction

Constant Summary collapse

ResponseEntity =
type_member
ResponseType =
type_member

Instance Method Summary collapse

Instance Method Details

#encode(entity) ⇒ Object



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

def encode(entity)
end

#map_request(&blk) ⇒ Object



24
25
26
27
28
# File 'lib/mayak/encoder.rb', line 24

def map_request(&blk)
  ::Mayak::Encoder::FromFunction[ResponseEntity, T.type_parameter(:NewResponse)].new do |entity|
    blk.call(encode(entity))
  end
end