Sha256: 7e8080c5b43b2037adf848dfcdf3d6108d69a4b40f4a21c111b12380ba56c17a

Contents?: true

Size: 288 Bytes

Versions: 2

Compression:

Stored size: 288 Bytes

Contents

class ExvoAuth::Autonomous::Cache
  def initialize
    @data = {}
  end
  
  def read(key)
    @data[key]
  end
  
  def write(key, value)
    @data[key] = value
  end
  
  def fetch(key)
    if block_given?
      read(key) || write(key, yield)
    else
      read(key)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
exvo-auth-0.6.1 lib/exvo_auth/autonomous/cache.rb
exvo-auth-0.6.0 lib/exvo_auth/autonomous/cache.rb