Class: ActionMessenger::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/action_messenger/message.rb

Overview

A message which will be sent, or which has been received.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bodyObject

The body of the message.


12
13
14
# File 'lib/action_messenger/message.rb', line 12

def body
  @body
end

#fromObject

The sender of the message.


9
10
11
# File 'lib/action_messenger/message.rb', line 9

def from
  @from
end

#subjectObject

The subject of the message.


15
16
17
# File 'lib/action_messenger/message.rb', line 15

def subject
  @subject
end

#toObject

The recipient of the message.


6
7
8
# File 'lib/action_messenger/message.rb', line 6

def to
  @to
end

Instance Method Details

#==(that) ⇒ Object

Compares this object with another for equality.

The other object is considered equal if it is not nil and all its fields are the same as this object's fields.


21
22
23
24
# File 'lib/action_messenger/message.rb', line 21

def ==(that)
  return false if that.nil?
  to == that.to and from == that.from and body == that.body and subject == that.subject
end