Module: Stash

Defined in:
lib/hoodie/stash.rb

Overview

Define the basic cache and default store objects

Defined Under Namespace

Classes: Cache

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

MemStash::Cache

Class Method Summary collapse

Class Method Details

.caller_nameObject

helper to get the calling function name



38
39
40
# File 'lib/hoodie/stash.rb', line 38

def 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



32
33
34
# File 'lib/hoodie/stash.rb', line 32

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