Sha256: b71a333459336e36c7e7e11970907e1e7bf70f4c19874015393df55270d47195
Contents?: true
Size: 652 Bytes
Versions: 26
Compression:
Stored size: 652 Bytes
Contents
module Euston module EventStore # Represents a single element in a stream of events. class EventMessage def initialize(arg = nil) if arg.is_a?(Hash) && (arg.keys & ['body','headers']).size == 2 @body, @headers = arg.values_at('body','headers') else @headers = {} @body = arg end end def to_hash {:headers=>@headers,:body=>@body} end # Gets the metadata which provides additional, unstructured information about this message. attr_reader :headers # Gets or sets the actual event message body. attr_reader :body end end end
Version data entries
26 entries across 26 versions & 1 rubygems