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, ProcEventHandler

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Object



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

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

#call(event) ⇒ Object

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

#process_event(event) ⇒ Object



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

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