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

#initialize(name) ⇒ Scope

Returns 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

#next_idObject



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

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

#to_sObject



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

def to_s
  @name
end