module Aws::Templates::Utils::Memoized

Simple memoization facility

Public Instance Methods

dirty!() click to toggle source

Cancel all memoizations

# File lib/aws/templates/utils/memoized.rb, line 10
def dirty!
  @memoized = nil
  self
end
memoize(id) { || ... } click to toggle source

Memoize block result

Return memoized value with the ID. If slot is empty - call the block

# File lib/aws/templates/utils/memoized.rb, line 19
def memoize(id)
  memoized[id] ||= yield
end
memoized() click to toggle source
# File lib/aws/templates/utils/memoized.rb, line 23
def memoized
  @memoized ||= {}
end