Class: Typed::Serializer

Inherits:
Object
  • Object
show all
Extended by:
T::Generic, T::Helpers, T::Sig
Defined in:
lib/typed/serializer.rb

Direct Known Subclasses

HashSerializer, JSONSerializer

Constant Summary collapse

Input =
type_member
Output =
type_member
Params =
T.type_alias { T::Hash[Symbol, T.untyped] }
DeserializeResult =
T.type_alias { Result[T::Struct, DeserializeError] }

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(schema:) ⇒ Serializer

Returns a new instance of Serializer.



19
20
21
# File 'lib/typed/serializer.rb', line 19

def initialize(schema:)
  @schema = schema
end

Instance Attribute Details

#schemaObject (readonly)

Returns the value of attribute schema.



16
17
18
# File 'lib/typed/serializer.rb', line 16

def schema
  @schema
end

Instance Method Details

#deserialize(source) ⇒ Object



24
25
# File 'lib/typed/serializer.rb', line 24

def deserialize(source)
end

#serialize(struct) ⇒ Object



28
29
# File 'lib/typed/serializer.rb', line 28

def serialize(struct)
end