Class: TarvitHelpers::HashPresenter::Cached
- Defined in:
- lib/tarvit-helpers/modules/hash_presenter/cached.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Simple
Instance Method Summary collapse
- #_value(method_name) ⇒ Object
-
#initialize(hash, levels = [], parent = nil) ⇒ Cached
constructor
A new instance of Cached.
Methods inherited from Simple
Constructor Details
#initialize(hash, levels = [], parent = nil) ⇒ Cached
Returns a new instance of Cached.
4 5 6 7 |
# File 'lib/tarvit-helpers/modules/hash_presenter/cached.rb', line 4 def initialize(hash, levels=[], parent=nil) super @cache = {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class TarvitHelpers::HashPresenter::Simple
Instance Method Details
#_value(method_name) ⇒ Object
9 10 11 |
# File 'lib/tarvit-helpers/modules/hash_presenter/cached.rb', line 9 def _value(method_name) @cache[method_name] ||= super end |