Class: DCell::Message::SystemEvent

Inherits:
DCell::Message show all
Defined in:
lib/dcell/messages.rb

Overview

Send a system event to the given recipient

Instance Attribute Summary collapse

Attributes inherited from DCell::Message

#id

Instance Method Summary collapse

Constructor Details

#initialize(recipient, event) ⇒ SystemEvent

Returns a new instance of SystemEvent.



69
70
71
72
# File 'lib/dcell/messages.rb', line 69

def initialize(recipient, event)
  super()
  @recipient, @event = recipient, event
end

Instance Attribute Details

#eventObject (readonly)

Returns the value of attribute event.



67
68
69
# File 'lib/dcell/messages.rb', line 67

def event
  @event
end

#recipientObject (readonly)

Returns the value of attribute recipient.



67
68
69
# File 'lib/dcell/messages.rb', line 67

def recipient
  @recipient
end

Instance Method Details

#dispatchObject



74
75
76
# File 'lib/dcell/messages.rb', line 74

def dispatch
  DCell::Router.route_system_event @recipient, @event
end