Class: LiveComponent::ObjectSerializer
- Inherits:
-
Object
- Object
- LiveComponent::ObjectSerializer
show all
- Defined in:
- lib/live_component/object_serializer.rb
Constant Summary
collapse
- OBJECT_SERIALIZER_KEY =
"_lc_ser"
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.make ⇒ Object
7
8
9
|
# File 'lib/live_component/object_serializer.rb', line 7
def self.make(...)
new(...)
end
|
Instance Method Details
#deserialize(hash) ⇒ Object
15
16
17
|
# File 'lib/live_component/object_serializer.rb', line 15
def deserialize(hash)
hash_to_object(hash)
end
|
#serialize(object) ⇒ Object
11
12
13
|
# File 'lib/live_component/object_serializer.rb', line 11
def serialize(object)
{ OBJECT_SERIALIZER_KEY => object.class.name }.merge!(object_to_hash(object))
end
|