Class: Ddr::Models::Cache

Inherits:
Hash
  • Object
show all
Defined in:
lib/ddr/models/cache.rb

Instance Method Summary collapse

Instance Method Details

#get(key) ⇒ Object



4
5
6
# File 'lib/ddr/models/cache.rb', line 4

def get(key)
  self[key]
end

#put(key, value) ⇒ Object



8
9
10
# File 'lib/ddr/models/cache.rb', line 8

def put(key, value)
  self[key] = value
end

#with(options, &block) ⇒ Object



12
13
14
15
16
17
# File 'lib/ddr/models/cache.rb', line 12

def with(options, &block)
  merge!(options)
  block_result = yield
  reject! { |k, v| options.include?(k) }
  block_result
end