Module: CachedEnumeration::Cache::ConstMissing

Defined in:
lib/cached_enumeration/cached_enumeration.rb

Instance Method Summary collapse

Instance Method Details

#const_missing_with_cache_enumeration(const_name) ⇒ Object



163
164
165
166
167
168
169
# File 'lib/cached_enumeration/cached_enumeration.rb', line 163

def const_missing_with_cache_enumeration(const_name)
  if cache_enumeration.cache! #if we just cached
    self.const_get(const_name) #try again
  else
    const_missing_without_cache_enumeration(const_name) #fails as usual
  end
end