Class: ActiveFedora::Orders::OrderedList::NodeCache
- Inherits:
-
Object
- Object
- ActiveFedora::Orders::OrderedList::NodeCache
- Defined in:
- lib/active_fedora/orders/ordered_list.rb
Instance Method Summary collapse
- #fetch(uri) ⇒ Object
-
#initialize ⇒ NodeCache
constructor
A new instance of NodeCache.
- #key?(key) ⇒ Boolean
Constructor Details
#initialize ⇒ NodeCache
Returns a new instance of NodeCache.
212 213 214 |
# File 'lib/active_fedora/orders/ordered_list.rb', line 212 def initialize @cache ||= {} end |
Instance Method Details
#fetch(uri) ⇒ Object
216 217 218 |
# File 'lib/active_fedora/orders/ordered_list.rb', line 216 def fetch(uri) @cache[uri] ||= yield if block_given? end |
#key?(key) ⇒ Boolean
220 221 222 |
# File 'lib/active_fedora/orders/ordered_list.rb', line 220 def key?(key) @cache.key?(key) end |