Permalink
Browse files

use constant directly instead of with const_get. Bonus points come wi…

…th the truthiness parody
  • Loading branch information...
markburns committed Apr 6, 2012
1 parent a95005f commit a8d94cbb732eb2cbb015c61aa6a5d74f660dd153
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/slanger/redis.rb
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 a8d94cb

Please sign in to comment.