Class: AudioBookCreator::CachedHash
- Inherits:
-
Object
- Object
- AudioBookCreator::CachedHash
- Defined in:
- lib/audio_book_creator/cached_hash.rb
Instance Attribute Summary collapse
-
#cache ⇒ Object
Returns the value of attribute cache.
- #caching layer(layer) ⇒ Object
-
#main ⇒ Object
Returns the value of attribute main.
- #main hash(hash) ⇒ Object
Instance Method Summary collapse
- #[](name) ⇒ Object
-
#initialize(cache, main) ⇒ CachedHash
constructor
A new instance of CachedHash.
Constructor Details
#initialize(cache, main) ⇒ CachedHash
Returns a new instance of CachedHash.
11 12 13 14 |
# File 'lib/audio_book_creator/cached_hash.rb', line 11 def initialize(cache, main) @cache = cache @main = main end |
Instance Attribute Details
#cache ⇒ Object
Returns the value of attribute cache.
5 6 7 |
# File 'lib/audio_book_creator/cached_hash.rb', line 5 def cache @cache end |
#caching layer(layer) ⇒ Object
5 |
# File 'lib/audio_book_creator/cached_hash.rb', line 5 attr_accessor :cache |
#main ⇒ Object
Returns the value of attribute main.
9 10 11 |
# File 'lib/audio_book_creator/cached_hash.rb', line 9 def main @main end |
#main hash(hash) ⇒ Object
9 |
# File 'lib/audio_book_creator/cached_hash.rb', line 9 attr_accessor :main |
Instance Method Details
#[](name) ⇒ Object
16 17 18 |
# File 'lib/audio_book_creator/cached_hash.rb', line 16 def [](name) @cache[name] ||= main[name] end |