Module: Memoized
- Defined in:
- lib/memoized.rb,
lib/memoized/version.rb,
lib/memoized/parameters.rb
Defined Under Namespace
Modules: ClassMethods, InstanceMethods
Classes: CannotMemoize, Parameters
Constant Summary
collapse
- VERSION =
'1.1.1'
Class Method Summary
collapse
Class Method Details
.ivar_name(method_name) ⇒ Object
15
16
17
|
# File 'lib/memoized.rb', line 15
def self.ivar_name(method_name)
:"@_memoized_#{self.safe_name(method_name)}"
end
|
.safe_name(method_name) ⇒ Object
11
12
13
|
# File 'lib/memoized.rb', line 11
def self.safe_name(method_name)
method_name.to_s.sub(/\?\Z/, '_query').sub(/!\Z/, '_bang').to_sym
end
|