Sha256: ba917daf54dc81ea98d7d1bad4fb5df833ff301517d739e0e107af54910d86a1
Contents?: true
Size: 681 Bytes
Versions: 17
Compression:
Stored size: 681 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, options = {}) self.class.actions.inject(false) do |matched, action| matched | action.call(self, message, options) end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems