Sha256: b73dffa44161cafbcc35a6de9907b86a539ace57b9819e3c825bb4ddb675c41d

Contents?: true

Size: 392 Bytes

Versions: 3

Compression:

Stored size: 392 Bytes

Contents

$LOAD_PATH.unshift("#{File.dirname(__FILE__)}")

module EnrichmentDb::Cache
	def self.get(query, values = nil)
    query_cache(query, values)
	end

  def self.set(query, values = nil, result = nil)
    query_cache(query, values, result)
  end

  def self.query_cache(query, values, result = nil)
    key = query + values.to_s
    @query_cache ||= {}
    @query_cache[key] ||= result
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
enrichment_db-0.1.13 lib/enrichment_db/cache.rb
enrichment_db-0.1.12 lib/enrichment_db/cache.rb
enrichment_db-0.1.11 lib/enrichment_db/cache.rb