Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
entity_cache / lib / entity_cache / controls / storage / persistent.rb
Size: Mime:
class EntityCache
  module Controls
    module Storage
      module Persistent
        class Example
          include EntityCache::Storage::Persistent

          def self.activate
            EntityCache::Storage::Persistent.add :control_example, self
          end

          def get(id)
            entity, version, time = records[id]

            return entity, version, time
          end

          def put(id, entity, version, time)
            records[id] = [entity, version, time]
          end

          def records
            @records ||= {}
          end

          module Assertions
            def stored?(id, entity, version, time)
              records[id] == [entity, version, time]
            end
          end
        end

        def self.example
          Example.build :some_subject
        end

        def self.substitute
          SubstAttr::Substitute.build Example
        end
      end
    end
  end
end