Sha256: 915ec868b931c4c170b5cbad36a452b49b993c1260e58a17b7697355797eb1e9

Contents?: true

Size: 399 Bytes

Versions: 1

Compression:

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

1 entries across 1 versions & 1 rubygems

Version Path
apotomo-1.1.3 lib/apotomo/event_handler.rb