Sha256: 728964d69eef0a03ae131eb19d23c361746963fc65808f7c25ba6be95107a4f8
Contents?: true
Size: 630 Bytes
Versions: 5
Compression:
Stored size: 630 Bytes
Contents
module Ruboty module Handlers class Base class << self include Mem def inherited(child) Ruboty.handlers << child end def on(pattern, options = {}) actions << Action.new(pattern, options) end def actions [] end memoize :actions end include Env::Validatable attr_reader :robot def initialize(robot) @robot = robot validate! end def call(message) self.class.actions.each do |action| action.call(self, message) end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems