class Ellen::Handlers::Base

Attributes

robot[R]

Public Class Methods

actions() click to toggle source
# File lib/ellen/handlers/base.rb, line 15
def actions
  []
end
inherited(child) click to toggle source
# File lib/ellen/handlers/base.rb, line 7
def inherited(child)
  Ellen.handlers << child
end
new(robot) click to toggle source
# File lib/ellen/handlers/base.rb, line 25
def initialize(robot)
  @robot = robot
  validate!
end
on(pattern, options = {}) click to toggle source
# File lib/ellen/handlers/base.rb, line 11
def on(pattern, options = {})
  actions << Action.new(pattern, options)
end

Public Instance Methods

call(message) click to toggle source
# File lib/ellen/handlers/base.rb, line 30
def call(message)
  self.class.actions.each do |action|
    action.call(self, message)
  end
end