Module: Messaging::Controls::Message

Included in:
Handler::BlockAndHandleMethod::Example, Handler::Example
Defined in:
lib/messaging/controls/message.rb

Defined Under Namespace

Modules: New Classes: OtherMessage, Read, SingleAttribute, SomeMessage

Constant Summary collapse

Example =
SomeMessage

Class Method Summary collapse

Class Method Details

.attributeObject



73
74
75
# File 'lib/messaging/controls/message.rb', line 73

def self.attribute
  'some value'
end

.dataObject



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
   ||= Controls::Metadata.example

  message = SomeMessage.new
  message.id = id
  message.some_attribute = some_attribute
  message.other_attribute = other_attribute

  message. = 

  message
end

.idObject



65
66
67
# File 'lib/messaging/controls/message.rb', line 65

def self.id
  ID::Random.example
end

.message_classObject



61
62
63
# File 'lib/messaging/controls/message.rb', line 61

def self.message_class
  SomeMessage
end

.other_attributeObject



77
78
79
# File 'lib/messaging/controls/message.rb', line 77

def self.other_attribute
  'other value'
end

.typeObject



69
70
71
# File 'lib/messaging/controls/message.rb', line 69

def self.type
  'SomeMessage'
end