Class: MassTransit::Serializer
- Inherits:
-
Object
- Object
- MassTransit::Serializer
- Defined in:
- lib/masstransit/serializer.rb
Instance Method Summary collapse
-
#deserialize(data) ⇒ Object
returns an Envelope.
- #serialize(env) ⇒ Object
Instance Method Details
#deserialize(data) ⇒ Object
returns an Envelope
16 17 18 19 20 21 22 |
# File 'lib/masstransit/serializer.rb', line 16 def deserialize(data) result = ActiveSupport::JSON.decode(data) result = MassTransit::Message.new(result) result end |
#serialize(env) ⇒ Object
10 11 12 13 |
# File 'lib/masstransit/serializer.rb', line 10 def serialize(env) #enforce that env is an Envelope return ActiveSupport::JSON.encode env end |