Class: Apotomo::EventHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/apotomo/event_handler.rb

Overview

EventHandlers are “callbacks”, not knowing why they exist, but what to do.

Direct Known Subclasses

InvokeEventHandler

Instance Method Summary (collapse)

Instance Method Details

- (Object) ==(other)



10
11
12
# File 'lib/apotomo/event_handler.rb', line 10

def ==(other)
  self.to_s == other.to_s
end

- (Object) call(event)

Invoked by Onfire.



15
16
17
# File 'lib/apotomo/event_handler.rb', line 15

def call(event)
  event.source.root.page_updates << process_event(event)
end

- (Object) process_event(event)



5
6
7
8
# File 'lib/apotomo/event_handler.rb', line 5

def process_event(event)
  # do something, and return content.
  nil
end