Module: Messaging::Controls::Metadata::Random
- Defined in:
- lib/messaging/controls/metadata.rb
Class Method Summary collapse
- .causation_message_global_position ⇒ Object
- .causation_message_identifier ⇒ Object
- .causation_message_position ⇒ Object
- .causation_message_stream_name ⇒ Object
- .correlation_stream_name ⇒ Object
- .data ⇒ Object
- .example ⇒ Object
- .global_position ⇒ Object
- .identifier ⇒ Object
- .local_properties ⇒ Object
- .position ⇒ Object
- .properties ⇒ Object
- .reply_stream_name ⇒ Object
- .schema_version ⇒ Object
- .stream_name ⇒ Object
- .time ⇒ Object
Class Method Details
.causation_message_global_position ⇒ Object
145 146 147 |
# File 'lib/messaging/controls/metadata.rb', line 145 def self. Controls::Random::Number.example end |
.causation_message_identifier ⇒ Object
165 166 167 |
# File 'lib/messaging/controls/metadata.rb', line 165 def self. "#{causation_message_stream_name}/#{causation_message_position}" end |
.causation_message_position ⇒ Object
141 142 143 |
# File 'lib/messaging/controls/metadata.rb', line 141 def self. Controls::Random::Number.example end |
.causation_message_stream_name ⇒ Object
137 138 139 |
# File 'lib/messaging/controls/metadata.rb', line 137 def self. Controls::Random::Text.example end |
.correlation_stream_name ⇒ Object
149 150 151 |
# File 'lib/messaging/controls/metadata.rb', line 149 def self.correlation_stream_name Controls::Random::Text.example end |
.data ⇒ Object
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 |
# File 'lib/messaging/controls/metadata.rb', line 185 def self.data { stream_name: stream_name, position: position, global_position: global_position, causation_message_stream_name: , causation_message_position: , causation_message_global_position: , correlation_stream_name: correlation_stream_name, reply_stream_name: reply_stream_name, properties: Properties::Random.example, local_properties: LocalProperties::Random.example, time: time, schema_version: schema_version } end |
.example ⇒ Object
120 121 122 123 124 125 126 127 |
# File 'lib/messaging/controls/metadata.rb', line 120 def self.example data = self.data data[:properties] = properties data[:local_properties] = local_properties Messaging::Message::Metadata.build(data) end |
.global_position ⇒ Object
169 170 171 |
# File 'lib/messaging/controls/metadata.rb', line 169 def self.global_position Controls::Random::Number.example end |
.identifier ⇒ Object
161 162 163 |
# File 'lib/messaging/controls/metadata.rb', line 161 def self.identifier "#{stream_name}/#{position}" end |
.local_properties ⇒ Object
181 182 183 |
# File 'lib/messaging/controls/metadata.rb', line 181 def self.local_properties LocalProperties::Random.example end |
.position ⇒ Object
133 134 135 |
# File 'lib/messaging/controls/metadata.rb', line 133 def self.position Controls::Random::Number.example end |
.properties ⇒ Object
177 178 179 |
# File 'lib/messaging/controls/metadata.rb', line 177 def self.properties Properties::Random.example end |
.reply_stream_name ⇒ Object
153 154 155 |
# File 'lib/messaging/controls/metadata.rb', line 153 def self.reply_stream_name Controls::Random::Text.example end |
.schema_version ⇒ Object
157 158 159 |
# File 'lib/messaging/controls/metadata.rb', line 157 def self.schema_version Controls::Random::Number.example.to_s end |
.stream_name ⇒ Object
129 130 131 |
# File 'lib/messaging/controls/metadata.rb', line 129 def self.stream_name Controls::Random::Text.example end |
.time ⇒ Object
173 174 175 |
# File 'lib/messaging/controls/metadata.rb', line 173 def self.time (::Time.now + Controls::Random::Number.example).utc end |