vendored/puppet/lib/puppet/pops/adapters.rb in bolt-0.21.7 vs vendored/puppet/lib/puppet/pops/adapters.rb in bolt-0.21.8

- old
+ new

@@ -1,8 +1,22 @@ # The Adapters module contains adapters for Documentation, Origin, SourcePosition, and Loader. # module Puppet::Pops module Adapters + + class ObjectIdCacheAdapter < Puppet::Pops::Adaptable::Adapter + attr_accessor :cache + + def initialize + @cache = {} + end + + # Retrieves a mutable hash with all stored values + def retrieve(o) + @cache[o.__id__] ||= {} + end + end + # A documentation adapter adapts an object with a documentation string. # (The intended use is for a source text parser to extract documentation and store this # in DocumentationAdapter instances). # class DocumentationAdapter < Adaptable::Adapter