Sha256: f92d07de5de4243ea0d264a414c87d08090c19aaaaca75c308755093bbe59584
Contents?: true
Size: 615 Bytes
Versions: 16
Compression:
Stored size: 615 Bytes
Contents
module Determinator module Retrieve # An retriever that returns features that were previously stored # in the retriever. Useful for testing. class InMemoryRetriever def initialize @features = {} end # @param name [string,symbol] The name of the feature to retrieve def retrieve(name) @features.fetch(name.to_s, MissingResponse.new) end # @param feature [Determinator::Feature] The feature to store def store(feature) @features[feature.name] = feature end def clear! @features.clear end end end end
Version data entries
16 entries across 16 versions & 1 rubygems