diff --git a/lib/redis_client/config.rb b/lib/redis_client/config.rb index b12dc28..4f75c75 100644 --- a/lib/redis_client/config.rb +++ b/lib/redis_client/config.rb @@ -41,7 +41,12 @@ def initialize( ) @username = username @password = password - @db = db || DEFAULT_DB + @db = begin + Integer(db || DEFAULT_DB) + rescue ArgumentError + raise ArgumentError, "db: must be an Integer, got: #{db.inspect}" + end + @id = id @ssl = ssl || false