lib/moleculer/packets/res.rb in moleculer-0.2.0 vs lib/moleculer/packets/res.rb in moleculer-0.3.0
- old
+ new
@@ -10,12 +10,12 @@
:data,
:error,
:meta,
:stream
- def initialize(data)
- super(data)
+ def initialize(config, data)
+ super(config, data)
@id = HashUtil.fetch(data, :id)
@success = HashUtil.fetch(data, :success)
@data = HashUtil.fetch(data, :data)
@error = HashUtil.fetch(data, :error, nil)
@@ -26,10 +26,10 @@
def topic
"#{super}.#{@node.id}"
end
- def as_json
+ def to_h
super.merge(
id: @id,
success: @success,
data: @data,
error: @error,