Module: Lab42::Memoizer

Extended by:
Memoizer
Included in:
Memoizer
Defined in:
lib/lab42/core/memoization.rb

Instance Method Summary collapse

Instance Method Details

#make_ivar_name(from_sym) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/lab42/core/memoization.rb', line 5

def make_ivar_name from_sym
  [
    '@',
  from_sym
    .to_s
    .sub('!', 'bang')
    .sub('?', '_p'),
    Time.now.nsec.to_s(36),
    SecureRandom.uuid.gsub('-','')
  ].join("_")
end