Class: Redis

Inherits:
Object
  • Object
show all
Defined in:
lib/redis-orm.rb,
lib/redis/actions.rb,
lib/redis/orm/version.rb

Defined Under Namespace

Modules: Actions, Relations, Validations Classes: ORM

Constant Summary collapse

@@connection =
nil

Class Method Summary collapse

Class Method Details

.connectionObject



8
9
10
# File 'lib/redis-orm.rb', line 8

def connection
  @@connection ||= Redis.new(:host => host, :port => port)
end

.connection=(redis) ⇒ Object



12
13
14
# File 'lib/redis-orm.rb', line 12

def connection=(redis)
  @@connection = redis
end

.hostObject



16
17
18
# File 'lib/redis-orm.rb', line 16

def host
  @host ||= 'localhost'
end

.host=(a) ⇒ Object



24
25
26
# File 'lib/redis-orm.rb', line 24

def host=(a)
  @host = a
end

.portObject



20
21
22
# File 'lib/redis-orm.rb', line 20

def port
  @port ||= 6379
end

.port=(a) ⇒ Object



28
29
30
# File 'lib/redis-orm.rb', line 28

def port=(a)
  @port = a
end