Class: ROM::Cache::Namespaced Private
- Inherits:
-
Object
- Object
- ROM::Cache::Namespaced
- Defined in:
- core/lib/rom/cache.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #cache ⇒ Object readonly private
- #namespace ⇒ Object readonly private
Instance Method Summary collapse
- #[](key) ⇒ Object private
- #fetch_or_store(*args) ⇒ Object private
-
#initialize(cache, namespace) ⇒ Namespaced
constructor
private
A new instance of Namespaced.
- #inspect ⇒ Object private
- #size ⇒ Object private
Constructor Details
#initialize(cache, namespace) ⇒ Namespaced
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Namespaced.
25 26 27 28 |
# File 'core/lib/rom/cache.rb', line 25 def initialize(cache, namespace) @cache = cache @namespace = namespace.to_sym end |
Instance Attribute Details
#cache ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
19 20 21 |
# File 'core/lib/rom/cache.rb', line 19 def cache @cache end |
#namespace ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
22 23 24 |
# File 'core/lib/rom/cache.rb', line 22 def namespace @namespace end |
Instance Method Details
#[](key) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
31 |
# File 'core/lib/rom/cache.rb', line 31 def [](key) = cache[[namespace, key]] |
#fetch_or_store(*args) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
34 35 36 |
# File 'core/lib/rom/cache.rb', line 34 def fetch_or_store(*args, &) cache.fetch_or_store([namespace, args], &) end |
#inspect ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
42 |
# File 'core/lib/rom/cache.rb', line 42 def inspect = %(#<#{self.class} size=#{size}>) |
#size ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
39 |
# File 'core/lib/rom/cache.rb', line 39 def size = cache.size |