Class: Handlers::HashHandler

Inherits:
Handler
  • Object
show all
Defined in:
lib/handlers/hash_handler.rb

Instance Method Summary collapse

Methods inherited from Handler

cache_class, #initialize

Constructor Details

This class inherits a constructor from Handlers::Handler

Instance Method Details

#get(key) ⇒ Object



9
10
11
# File 'lib/handlers/hash_handler.rb', line 9

def get(key)
  @cache[key]
end

#increment(key) ⇒ Object



5
6
7
# File 'lib/handlers/hash_handler.rb', line 5

def increment(key)
  @cache[key] = (get(key)||0).to_i+1
end