lib/maglev/utils/memo.rb
# # instance version, which allows you to define a traditional method (much easier to navigate code structure using code tools)
# # and then juse use memo from within the method body.
# # i.e.
# #    def foo
# #       memo(:foo) { 1 + 1 }
# #    end
instance version, which allows you to define a traditional method (much easier to navigate code structure using code tools)
and then juse use memo from within the method body.
instance version which allows you to define a traditional method ( much easier to navigate code structure using code tools ) and then juse use memo from within the method body .
def memo(name, &block)
      @__memoized ||= {}
      if @__memoized.key?(name)
        @__memoized[name]
      else
        @__memoized[name] = block.call
      end
    end
def memo ( name , & block ) @__memoized ||= { } if @__memoized . key? ( name ) @__memoized [ name ] else @__memoized [ name ] = block . call end end
instance version, which allows you to define a traditional method (much easier to navigate code structure using code tools)
 and then juse use memo from within the method body.
instance version which allows you to define a traditional method ( much easier to navigate code structure using code tools ) and then juse use memo from within the method body .
name
<not_specific>
block
<not_specific>