lib/rabbit/receiving/message.rb in rabbit_messaging-0.7.1 vs lib/rabbit/receiving/message.rb in rabbit_messaging-0.8.1

- old
+ new

@@ -8,19 +8,26 @@ class Message include Tainbox attribute :group_id attribute :project_id + attribute :message_id attribute :event attribute :data + attribute :arguments attribute :original_message - attr_accessor :original_message + def self.build(message, arguments) + group_id, project_id = arguments.fetch(:app_id).split(".") - def self.build(message, type:, app_id:, **) - group_id, project_id = app_id.split(".") - - new(group_id: group_id, project_id: project_id, event: type, data: message) + new( + group_id: group_id, + project_id: project_id, + event: arguments.fetch(:type), + data: message, + message_id: arguments.fetch(:message_id, nil), + arguments: arguments, + ) end def data=(value) self.original_message = value super(JSON.parse(value).deep_symbolize_keys)