replace const_defined? with defined?

This commit is contained in:
Brian Kephart 2018-05-13 16:44:20 -05:00
parent 863cfe4057
commit b5b4164967

View file

@ -5,14 +5,7 @@ module Rack
module StoreProxy
class RedisStoreProxy < SimpleDelegator
def self.handle?(store)
# Using const_defined? for now.
#
# Go back to use defined? once this ruby issue is
# fixed and released:
# https://bugs.ruby-lang.org/issues/14407
#
# defined?(::Redis::Store) && store.is_a?(::Redis::Store)
const_defined?("::Redis::Store") && store.is_a?(::Redis::Store)
defined?(::Redis::Store) && store.is_a?(::Redis::Store)
end
def initialize(store)