Class: Redistat::Scope

Inherits:
Object
  • Object
show all
Includes:
Database
Defined in:
lib/redistat/scope.rb

Instance Method Summary (collapse)

Methods included from Database

#db, included

Constructor Details

- (Scope) initialize(name)

A new instance of Scope



5
6
7
# File 'lib/redistat/scope.rb', line 5

def initialize(name)
  @name = name.to_s
end

Instance Method Details

- (Object) next_id



13
14
15
# File 'lib/redistat/scope.rb', line 13

def next_id
  db.incr("#{@name}#{KEY_NEXT_ID}")
end

- (Object) to_s



9
10
11
# File 'lib/redistat/scope.rb', line 9

def to_s
  @name
end