class RedisRecord::Connection
Attributes
connection[RW]
Public Class Methods
connect()
click to toggle source
# File lib/redis_record/config.rb, line 5 def self.connect begin @@connection= nil host= RedisRecord::Connection::Host port= RedisRecord::Connection::Port db= RedisRecord::Connection::Db @@connection = Redis.new(:host => host, :port => port, :db => db) @@connection.Ping == "PONG" rescue @@connection= nil end @@connection end
connection()
click to toggle source
# File lib/redis_record/config.rb, line 27 def self.connection @@connection end
isConnected?()
click to toggle source
# File lib/redis_record/config.rb, line 19 def self.isConnected? begin return @@connection && @@connection.client.connected? && @@connection.Ping == "PONG" rescue return false end end