Permalink
Browse files

Merge pull request #24 from markburns/master

Remove const_get in Slanger::Redis
  • Loading branch information...
stevegraham committed Apr 6, 2012
2 parents a63ee30 + a8d94cb commit d64a9a35a9083b9f74df3c9eada52b294b749d01
Showing with 3 additions and 3 deletions.
  1. +1 −1 Gemfile.lock
  2. +2 −2 lib/slanger/redis.rb
View
@@ -62,7 +62,7 @@ GEM
ruby-hmac
sinatra (1.2.6)
rack (~> 1.1)
- tilt (< 2.0, >= 1.2.2)
+ tilt (>= 1.2.2, < 2.0)
thin (1.2.11)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
View
@@ -11,8 +11,8 @@ def self.extended base
# Dispatch messages received from Redis to their destination channel.
base.on(:message) do |channel, message|
message = JSON.parse message
- const = message['channel'] =~ /^presence-/ ? 'PresenceChannel' : 'Channel'
- Slanger.const_get(const).find_or_create_by_channel_id(message['channel']).dispatch message, channel
+ klass = message['channel'][/^presence-/] ? PresenceChannel : Channel
+ klass.find_or_create_by_channel_id(message['channel']).dispatch message, channel
end
end

0 comments on commit d64a9a3

Please sign in to comment.