Module: Dynflow::Listeners::Serialization::Protocol::Event
- Defined in:
- lib/dynflow/listeners/serialization.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#to_hash ⇒ Object
TODO fix the workaround marshal and then use base64 because not all json libs can correctly escape binary data.
Class Method Details
.product_from_hash(hash) ⇒ Object
41 42 43 |
# File 'lib/dynflow/listeners/serialization.rb', line 41 def self.product_from_hash(hash) super(hash.merge 'event' => Marshal.load(Base64.strict_decode64(hash.fetch('event')))) end |
Instance Method Details
#to_hash ⇒ Object
TODO fix the workaround marshal and then use base64 because not all json libs can correctly escape binary data
37 38 39 |
# File 'lib/dynflow/listeners/serialization.rb', line 37 def to_hash super.update event: Base64.strict_encode64(Marshal.dump(event)) end |