Class: MessageBus::Codec::Json

Inherits:
Base
  • Object
show all
Defined in:
lib/message_bus/codec/json.rb

Instance Method Summary collapse

Instance Method Details

#decode(payload) ⇒ Object



10
11
12
# File 'lib/message_bus/codec/json.rb', line 10

def decode(payload)
  JSON.parse(payload)
end

#encode(hash) ⇒ Object



6
7
8
# File 'lib/message_bus/codec/json.rb', line 6

def encode(hash)
  JSON.dump(hash)
end