Sha256: b442d3c1f76913538c381c932203b284614ba7ad581aad640d8baf05807e9671

Contents?: true

Size: 313 Bytes

Versions: 5

Compression:

Stored size: 313 Bytes

Contents

class PersistenceLayer
  def self.registry
    @registry ||= []
  end
  def initialize
    self.class.registry << self
  end
  def self.find(id)
    @registry.find {|obj| obj.to_key == Array(id)}
  end

  def persisted?; true; end
  def to_param; String(object_id); end
  def to_key; [String(object_id)]; end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
activity_engine-0.0.9 spec/support/persistence_layer.rb
activity_engine-0.0.8 spec/support/persistence_layer.rb
activity_engine-0.0.7 spec/support/persistence_layer.rb
activity_engine-0.0.6 spec/support/persistence_layer.rb
activity_engine-0.0.5 spec/support/persistence_layer.rb