class Csv2Psql::Cache
Last Recently Used cache implementation
Attributes
max_size[RW]
Public Class Methods
new(max_size = 1000)
click to toggle source
# File lib/csv2psql/cache/cache.rb, line 10 def initialize(max_size = 1000) @cache = ::Cache::LRU.new(max_elements: max_size) end
Public Instance Methods
get(key, &block)
click to toggle source
# File lib/csv2psql/cache/cache.rb, line 18 def get(key, &block) @cache.get(key, &block) end
put(key, value)
click to toggle source
# File lib/csv2psql/cache/cache.rb, line 14 def put(key, value) @cache.put(key, value) end