module PipeRpc class Hub::Socket class Outgoing def initialize(object) @object = object end def to_h @hash ||= @object.to_h end def to_payload @payload ||= JSON.dump(to_h) end def trigger(callbacks) callbacks.each{ |callback| callback.call(to_h) } end end end end