Class: Mayak::Http::Encoder::FromHashSerializableJson

Inherits:
T::Struct
  • Object
show all
Extended by:
T::Generic, T::Helpers, T::Sig
Includes:
Mayak::Http::Encoder
Defined in:
lib/mayak/http/encoder.rb

Constant Summary collapse

ResponseEntity =
type_member {{ fixed: ::Mayak::HashSerializable }}
ResponseType =
type_member {{ fixed: Mayak::Http::Response }}

Instance Method Summary collapse

Methods included from Encoder

#map_request

Instance Method Details

#encode(entity) ⇒ Object



69
70
71
72
73
74
75
# File 'lib/mayak/http/encoder.rb', line 69

def encode(entity)
  Mayak::Http::Response.new(
    status:  default_status,
    headers: default_headers,
    body:    Mayak::Json.dump(entity.serialize)
  )
end