Module: Messaging::Message::Import

Defined in:
lib/messaging/message/import.rb

Constant Summary collapse

Error =
Class.new(RuntimeError)

Class Method Summary collapse

Class Method Details

.call(message_data, message_class) ⇒ Object

Raises:



6
7
8
9
10
# File 'lib/messaging/message/import.rb', line 6

def self.call(message_data, message_class)
  raise Error, "Message class #{message_class} doesn't match MessageData type #{message_data.type.inspect}" unless message_class.message_type?(message_data.type)

  ::Transform::Read.(message_data, :message_data, message_class)
end