Class: ActiveFedora::Orders::OrderedList::NodeCache

Inherits:
Object
  • Object
show all
Defined in:
lib/active_fedora/orders/ordered_list.rb

Instance Method Summary collapse

Constructor Details

#initializeNodeCache

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

Returns:

  • (Boolean)


220
221
222
# File 'lib/active_fedora/orders/ordered_list.rb', line 220

def key?(key)
  @cache.key?(key)
end