Sha256: 6bfa781b899308e715d1a96c77daf67ca9d1ad6424efc30693b5e15718b0851d

Contents?: true

Size: 480 Bytes

Versions: 12

Compression:

Stored size: 480 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

require 'apotomo/invoke_event_handler'
require 'apotomo/proc_event_handler'

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
apotomo-1.0.5 lib/apotomo/event_handler.rb
apotomo-1.0.4 lib/apotomo/event_handler.rb
apotomo-1.0.3 lib/apotomo/event_handler.rb
apotomo-1.0.2 lib/apotomo/event_handler.rb
apotomo-1.0.1 lib/apotomo/event_handler.rb
apotomo-1.0.0 lib/apotomo/event_handler.rb
apotomo-1.0.0.beta2 lib/apotomo/event_handler.rb
apotomo-1.0.0.beta1 lib/apotomo/event_handler.rb
apotomo-0.1.4 lib/apotomo/event_handler.rb
apotomo-0.1.3 lib/apotomo/event_handler.rb
apotomo-0.1.2 lib/apotomo/event_handler.rb
apotomo-0.1.1 lib/apotomo/event_handler.rb