Module: Messaging::Controls::Metadata

Defined in:
lib/messaging/controls/metadata.rb

Defined Under Namespace

Modules: New, Random, Written

Constant Summary collapse

Empty =
New

Class Method Summary collapse

Class Method Details

.causation_message_global_positionObject



30
31
32
# File 'lib/messaging/controls/metadata.rb', line 30

def self.causation_message_global_position
  111
end

.causation_message_identifierObject



50
51
52
# File 'lib/messaging/controls/metadata.rb', line 50

def self.causation_message_identifier
  "#{causation_message_stream_name}/#{causation_message_position}"
end

.causation_message_positionObject



26
27
28
# File 'lib/messaging/controls/metadata.rb', line 26

def self.causation_message_position
  11
end

.causation_message_stream_nameObject



22
23
24
# File 'lib/messaging/controls/metadata.rb', line 22

def self.causation_message_stream_name
  "someCausation"
end

.correlation_stream_nameObject



34
35
36
# File 'lib/messaging/controls/metadata.rb', line 34

def self.correlation_stream_name
  "someCorrelation"
end

.dataObject



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/messaging/controls/metadata.rb', line 70

def self.data
  {
    stream_name: stream_name,
    position: position,
    global_position: global_position,

    causation_message_stream_name: causation_message_stream_name,
    causation_message_position: causation_message_position,
    causation_message_global_position: causation_message_global_position,

    correlation_stream_name: correlation_stream_name,

    reply_stream_name: reply_stream_name,

    properties: Properties.example,
    local_properties: LocalProperties.example,

    time: time,

    schema_version: schema_version
  }
end

.exampleObject



4
5
6
7
8
# File 'lib/messaging/controls/metadata.rb', line 4

def self.example
  data = self.data

  Messaging::Message::Metadata.build(data)
end

.global_positionObject



18
19
20
# File 'lib/messaging/controls/metadata.rb', line 18

def self.global_position
  222
end

.identifierObject



46
47
48
# File 'lib/messaging/controls/metadata.rb', line 46

def self.identifier
  "#{stream_name}/#{position}"
end

.local_propertiesObject



66
67
68
# File 'lib/messaging/controls/metadata.rb', line 66

def self.local_properties
  LocalProperties.example
end

.positionObject



14
15
16
# File 'lib/messaging/controls/metadata.rb', line 14

def self.position
  1
end

.propertiesObject



54
55
56
# File 'lib/messaging/controls/metadata.rb', line 54

def self.properties
  Properties.example
end

.reply_stream_nameObject



38
39
40
# File 'lib/messaging/controls/metadata.rb', line 38

def self.reply_stream_name
  "someReply"
end

.schema_versionObject



42
43
44
# File 'lib/messaging/controls/metadata.rb', line 42

def self.schema_version
  '1.1'
end

.stream_nameObject



10
11
12
# File 'lib/messaging/controls/metadata.rb', line 10

def self.stream_name
  'someSource'
end

.timeObject



58
59
60
# File 'lib/messaging/controls/metadata.rb', line 58

def self.time
  Time::Raw.example
end