Module: Messaging::Controls::Message
Defined Under Namespace
Modules: New
Classes: OtherMessage, Read, SingleAttribute, SomeMessage
Constant Summary
collapse
- Example =
SomeMessage
Class Method Summary
collapse
Class Method Details
.attribute ⇒ Object
73
74
75
|
# File 'lib/messaging/controls/message.rb', line 73
def self.attribute
'some value'
end
|
.data ⇒ Object
81
82
83
84
85
86
|
# File 'lib/messaging/controls/message.rb', line 81
def self.data
{
some_attribute: attribute,
other_attribute: other_attribute
}
end
|
.example(id: nil, some_attribute: nil, metadata: nil) ⇒ Object
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/messaging/controls/message.rb', line 4
def self.example(id: nil, some_attribute: nil, metadata: nil)
if id == :none
id = nil
else
id ||= self.id
end
some_attribute ||= attribute
metadata ||= Controls::Metadata.example
message = SomeMessage.new
message.id = id
message.some_attribute = some_attribute
message.other_attribute = other_attribute
message.metadata = metadata
message
end
|
.id ⇒ Object
65
66
67
|
# File 'lib/messaging/controls/message.rb', line 65
def self.id
ID::Random.example
end
|
.message_class ⇒ Object
61
62
63
|
# File 'lib/messaging/controls/message.rb', line 61
def self.message_class
SomeMessage
end
|
.other_attribute ⇒ Object
77
78
79
|
# File 'lib/messaging/controls/message.rb', line 77
def self.other_attribute
'other value'
end
|
.type ⇒ Object
69
70
71
|
# File 'lib/messaging/controls/message.rb', line 69
def self.type
'SomeMessage'
end
|