HParker/sock-drawer

View on GitHub
lib/sock/subscriber.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Sock
  # module for catching events fired from redis
  module Subscriber
    def self.included(base)
      base.extend(SubscriberDSL)
    end

    module SubscriberDSL
      def on(channel, &block)
        channels[channel] = block
      end

      def channels
        @_channels ||= {}
      end
    end
  end
end