Class: Synapse::Serialization::SerializedMessageBuilder
- Inherits:
-
Object
- Object
- Synapse::Serialization::SerializedMessageBuilder
show all
- Defined in:
- lib/synapse/serialization/message/serialized_message_builder.rb
Overview
Message builder capable of producing SerializedMessage instances
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Instance Attribute Details
#id ⇒ String
6
7
8
|
# File 'lib/synapse/serialization/message/serialized_message_builder.rb', line 6
def id
@id
end
|
9
10
11
|
# File 'lib/synapse/serialization/message/serialized_message_builder.rb', line 9
def metadata
@metadata
end
|
12
13
14
|
# File 'lib/synapse/serialization/message/serialized_message_builder.rb', line 12
def payload
@payload
end
|
#timestamp ⇒ Time
15
16
17
|
# File 'lib/synapse/serialization/message/serialized_message_builder.rb', line 15
def timestamp
@timestamp
end
|
Class Method Details
.build {|builder| ... } ⇒ Object
17
18
19
20
21
22
23
|
# File 'lib/synapse/serialization/message/serialized_message_builder.rb', line 17
def self.build
builder = self.new
yield builder if block_given?
builder.build
end
|
Instance Method Details
#build ⇒ Object
25
26
27
|
# File 'lib/synapse/serialization/message/serialized_message_builder.rb', line 25
def build
SerializedMessage.new @id, @metadata, @payload, @timestamp
end
|