Class: Omega::Server::HandledEvent

Inherits:
Event show all
Defined in:
lib/omega/server/event.rb

Overview

Event with built in handler

Instance Attribute Summary

Attributes inherited from Event

#handlers, #id, #registry, #timestamp, #type

Instance Method Summary collapse

Methods inherited from Event

#event_args, #invoke, json_create, #json_data, #should_exec?, #time_elapsed?, #to_json, #to_s

Constructor Details

#initialize(args = {}) ⇒ HandledEvent

Returns a new instance of HandledEvent


103
104
105
106
107
# File 'lib/omega/server/event.rb', line 103

def initialize(args = {})
  super(args)

  @handlers.unshift proc { |e| handle_event }
end

Instance Method Details

#handlers_jsonObject

Omit locally managed handler from handlers


118
119
120
# File 'lib/omega/server/event.rb', line 118

def handlers_json
  {:handlers => handlers[1..-1]}
end