module Memoized

Constants

VERSION

Public Class Methods

included(base) click to toggle source
# File lib/memoized.rb, line 2
def self.included(base)
  base.extend ClassMethods
  base.send :include, InstanceMethods
end
ivar_name(method_name) click to toggle source
# File lib/memoized.rb, line 11
def self.ivar_name(method_name)
  :"@_memoized_#{self.safe_name(method_name)}"
end
safe_name(method_name) click to toggle source
# File lib/memoized.rb, line 7
def self.safe_name(method_name)
  method_name.to_s.sub(/\?\Z/, '_query').sub(/!\Z/, '_bang').to_sym
end