Class: Mayak::Decoder::Implementation
- Inherits:
-
Object
- Object
- Mayak::Decoder::Implementation
- Extended by:
- T::Generic, T::Helpers, T::Sig
- Includes:
- Mayak::Decoder
- Defined in:
- lib/mayak/decoder.rb
Constant Summary collapse
- In =
type_member- Out =
type_member
Instance Method Summary collapse
- #decode(response) ⇒ Object
-
#initialize(&function) ⇒ Implementation
constructor
A new instance of Implementation.
Methods included from Mayak::Decoder
Constructor Details
#initialize(&function) ⇒ Implementation
45 46 47 |
# File 'lib/mayak/decoder.rb', line 45 def initialize(&function) @function = T.let(function, T.proc.params(response: In).returns(::Mayak::Monads::Try[Out])) end |
Instance Method Details
#decode(response) ⇒ Object
54 55 56 |
# File 'lib/mayak/decoder.rb', line 54 def decode(response) @function.call(response) end |