Sha256: 96f1cbf9507ffc82138ea20dd0e429739d7949b8255c7d6fd8a491c287b223ba

Contents?: true

Size: 404 Bytes

Versions: 15

Compression:

Stored size: 404 Bytes

Contents

module Apotomo
  # EventHandlers are "callbacks", not knowing why they exist, but what to do.
  class EventHandler
    
    def process_event(event)
      # do something, and return content.
      nil
    end
    
    def ==(other)
      self.to_s == other.to_s
    end
    
    # Invoked by Onfire.
    def call(event)
      event.source.root.page_updates << process_event(event)
    end
    
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
apotomo-1.3.2 lib/apotomo/event_handler.rb
apotomo-1.3.1 lib/apotomo/event_handler.rb
apotomo-1.3.0 lib/apotomo/event_handler.rb
apotomo-1.2.6 lib/apotomo/event_handler.rb
apotomo-1.2.5 lib/apotomo/event_handler.rb
apotomo-1.2.4 lib/apotomo/event_handler.rb
apotomo-1.2.3 lib/apotomo/event_handler.rb
apotomo-1.2.2 lib/apotomo/event_handler.rb
apotomo-1.2.1 lib/apotomo/event_handler.rb
apotomo-1.2.0 lib/apotomo/event_handler.rb
apotomo-1.1.4 lib/apotomo/event_handler.rb
apotomo-1.1.2 lib/apotomo/event_handler.rb
apotomo-1.1.1 lib/apotomo/event_handler.rb
apotomo-1.1.0 lib/apotomo/event_handler.rb
apotomo-1.1.0.rc1 lib/apotomo/event_handler.rb