Module: Hoodie::Stash

Defined in:
lib/hoodie/stash.rb,
lib/hoodie/stash/cache.rb,
lib/hoodie/stash/mem_store.rb,
lib/hoodie/stash/disk_store.rb

Overview

Define the basic cache and default store objects

Defined Under Namespace

Classes: Cache, DiskStore, MemStore

Constant Summary collapse

NEW_CALL =

check if we’re using a version if Ruby that supports caller_locations

Kernel.respond_to? 'caller_locations'
DEFAULT_STORE =

Default store type

MemStore.new

Class Method Summary collapse

Class Method Details

.caller_nameObject

helper to get the calling function name



40
41
42
# File 'lib/hoodie/stash.rb', line 40

def self.caller_name
  NEW_CALL ? caller_locations(2, 1).first.label : caller[1][/`([^']*)'/, 1]
end

.new(*args) ⇒ Object

insert a helper .new() method for creating a new object



34
35
36
# File 'lib/hoodie/stash.rb', line 34

def self.new(*args)
  self::Cache.new(*args)
end