module Ruboty::Stats::Recorder

Public Instance Methods

call(handler, message) click to toggle source
Calls superclass method
# File lib/ruboty/stats.rb, line 10
def call(handler, message)
  if perform?(handler, message)
    action_name = "#{handler.class.name}##{name}"
    Ruboty::Stats.stats(handler.robot)[action_name] ||= []
    stats = {from: message.from, body: message.body, time: Time.now}
    Ruboty::Stats.stats(handler.robot)[action_name] << stats
  end

  super
end
perform?(handler, message) click to toggle source
# File lib/ruboty/stats.rb, line 21
def perform?(handler, message)
  message.match pattern_with(handler.robot.name)
end