Sha256: d0dc43efef90505a33c7d70474140d4b91dff25c529b5644e9035cfbf7d29d6b

Contents?: true

Size: 425 Bytes

Versions: 8

Compression:

Stored size: 425 Bytes

Contents

#:enddoc:
module RailsConnector

class Cache
  @cache = {}
  @context = false

  def self.begin_context
    @context = true
  end

  def self.end_context
    @context = false
    reset
  end

  def self.in_context?
    @context
  end

  def self.load(key)
    @cache[key]
  end

  def self.store(key, value)
    @cache[key] = value if @context
  end

  def self.reset
    @cache.clear
  end
end

end # module RailsConnector

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
infopark_cloud_connector-6.8.0.beta.200.785.05d4af9 lib/rails_connector/cache.rb
infopark_cloud_connector-6.8.0.beta.200.744.99f67fc lib/rails_connector/cache.rb
infopark_cloud_connector-6.8.0.beta.200.720.44fbabd lib/rails_connector/cache.rb
infopark_cloud_connector-6.8.0.beta.200.713.e5c3150 lib/rails_connector/cache.rb
infopark_cloud_connector-6.8.0.beta.200.681.7c84f4a lib/rails_connector/cache.rb
infopark_cloud_connector-6.8.0.beta.200.663.ceecdee lib/rails_connector/cache.rb
infopark_cloud_connector-6.8.0.beta.200.650.7c93155 lib/rails_connector/cache.rb
infopark_cloud_connector-6.8.0.beta.200.621.4c8e1b0 lib/rails_connector/cache.rb