Sha256: 5b7c32786f5dc6402c53ed4022616f4bb0d976d1d920658c77c4a984c291b5bf

Contents?: true

Size: 586 Bytes

Versions: 11

Compression:

Stored size: 586 Bytes

Contents

# frozen_string_literal: true

module Twitch
  module Bot
    # Handles a message of a specific type
    class EventHandler
      attr_reader :event, :client

      def initialize(event:, client:)
        @event = event
        @client = client
      end

      #
      # Handle the event
      #
      # @return void
      #
      def call
        raise "Unhandled #{event.type}"
      end

      #
      # Return a list of event types this handler can handle
      #
      # @return [Array] event type list
      #
      def self.handled_events
        []
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
twitch-bot-4.1.0 lib/twitch/bot/event_handler.rb
twitch-bot-4.0.1 lib/twitch/bot/event_handler.rb
twitch-bot-4.0.0 lib/twitch/bot/event_handler.rb
twitch-bot-3.2.1 lib/twitch/bot/event_handler.rb
twitch-bot-3.2.0 lib/twitch/bot/event_handler.rb
twitch-bot-3.1.0 lib/twitch/bot/event_handler.rb
twitch-bot-2.1.1 lib/twitch/bot/event_handler.rb
twitch-bot-2.1.0 lib/twitch/bot/event_handler.rb
twitch-bot-2.0.1 lib/twitch/bot/event_handler.rb
twitch-bot-2.0.0 lib/twitch/bot/event_handler.rb
twitch-bot-1.0.0 lib/twitch/bot/event_handler.rb