Permalink
Browse files

event shall be a Hash

  • Loading branch information...
tbuehlmann committed Sep 7, 2012
1 parent 7082ae0 commit 1dbd77c072ea0a105df4010c723cb2427b4211d4
Showing with 9 additions and 5 deletions.
  1. +9 −5 lib/ponder/callback.rb
View
@@ -16,12 +16,16 @@ def initialize(pattern = //, options = {}, proc = Proc.new {})
end
def matching?(event)
- if [:channel, :query].include? event[:type]
- event[:message] =~ @pattern ? true : false
- elsif event[:type] == :topic
- event[:topic] =~ @pattern ? true : false
+ if event.is_a? Hash
+ if [:channel, :query].include? event[:type]
+ event[:message] =~ @pattern ? true : false
+ elsif event[:type] == :topic
+ event[:topic] =~ @pattern ? true : false
+ else
+ true
+ end
else
- true
+ false
end
end

0 comments on commit 1dbd77c

Please sign in to comment.