Module: Persistence::Adapter::Abstract::PrimaryKey::Simple

Included in:
Mock::Bucket::BucketInterface
Defined in:
lib/persistence/adapter/abstract/primary_key/simple.rb

Overview

Provides primary key with attribute name to including adapter class.

Instance Method Summary collapse

Instance Method Details

#primary_key_for_attribute_name(object, attribute_name) ⇒ Object

Returns a primary key for storage in adapter (self). Generated from object instance and attribute name.

Any further constraints are a function of the adapter's requirements, not of Persistence.
This implementation simply returns the attribute name.

Parameters:

  • object

    Object instance for which to generate primary key.

  • attribute_name

    Attribute name key refers to.

Returns:

  • String Primary key for use in adapter (self).



23
24
25
26
27
# File 'lib/persistence/adapter/abstract/primary_key/simple.rb', line 23

def primary_key_for_attribute_name( object, attribute_name )

  return attribute_name

end