Class: DCell::Message::Relay
- Inherits:
-
DCell::Message
- Object
- DCell::Message
- DCell::Message::Relay
- Defined in:
- lib/dcell/messages.rb
Overview
Relay a message to the given recipient
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#recipient ⇒ Object
readonly
Returns the value of attribute recipient.
Attributes inherited from DCell::Message
Instance Method Summary collapse
- #dispatch ⇒ Object
-
#initialize(recipient, message) ⇒ Relay
constructor
A new instance of Relay.
Constructor Details
#initialize(recipient, message) ⇒ Relay
Returns a new instance of Relay.
55 56 57 58 |
# File 'lib/dcell/messages.rb', line 55 def initialize(recipient, ) super() @recipient, @message = recipient, end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
53 54 55 |
# File 'lib/dcell/messages.rb', line 53 def @message end |
#recipient ⇒ Object (readonly)
Returns the value of attribute recipient.
53 54 55 |
# File 'lib/dcell/messages.rb', line 53 def recipient @recipient end |
Instance Method Details
#dispatch ⇒ Object
60 61 62 |
# File 'lib/dcell/messages.rb', line 60 def dispatch @recipient << @message end |