Class: Redistat::Scope
- Inherits:
-
Object
- Object
- Redistat::Scope
- Includes:
- Database
- Defined in:
- lib/redistat/scope.rb
Instance Method Summary collapse
-
#initialize(name) ⇒ Scope
constructor
A new instance of Scope.
- #next_id ⇒ Object
- #to_s ⇒ Object
Methods included from Database
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_id ⇒ Object
13 14 15 |
# File 'lib/redistat/scope.rb', line 13 def next_id db.incr("#{@name}#{KEY_NEXT_ID}") end |
#to_s ⇒ Object
9 10 11 |
# File 'lib/redistat/scope.rb', line 9 def to_s @name end |