Module: CacheMethod

Defined in:
lib/cache_method.rb,
lib/cache_method/debug.rb,
lib/cache_method/config.rb,
lib/cache_method/version.rb,
lib/cache_method/generation.rb,
lib/cache_method/cached_result.rb

Overview

See the README.rdoc for more info!

Defined Under Namespace

Modules: ClassMethods, InstanceMethods Classes: CachedResult, Config, Generation

Constant Summary collapse

VERSION =
"0.2.3"

Class Method Summary collapse

Class Method Details

.configObject

:nodoc:



7
8
9
# File 'lib/cache_method.rb', line 7

def self.config #:nodoc:
  Config.instance
end

.klass_name(obj) ⇒ Object

:nodoc:



11
12
13
# File 'lib/cache_method.rb', line 11

def self.klass_name(obj) #:nodoc:
  (obj.is_a?(::Class) or obj.is_a?(::Module)) ? obj.to_s : obj.class.to_s
end

.method_delimiter(obj) ⇒ Object

:nodoc:



15
16
17
# File 'lib/cache_method.rb', line 15

def self.method_delimiter(obj) #:nodoc:
  (obj.is_a?(::Class) or obj.is_a?(::Module)) ? '.' : '#'
end

.method_signature(obj, method_id) ⇒ Object

:nodoc:



19
20
21
# File 'lib/cache_method.rb', line 19

def self.method_signature(obj, method_id) #:nodoc:
  [ klass_name(obj), method_id ].join method_delimiter(obj)
end