Class: DataMapper::OrderedSet::Cache Private

Inherits:
Object
  • Object
show all
Includes:
API
Defined in:
lib/dm-core/support/ordered_set.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

The default cache used by DataMapper::OrderedSet

Uses a Hash as internal storage and enforces set semantics by calling #eql? and #hash on the set’s entries.

Defined Under Namespace

Modules: API

Instance Method Summary collapse

Methods included from API

#[], #[]=, #clear, #delete, #include?, #initialize

Instance Method Details

#key_for(entry) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Given an entry, return the key to be used in the cache

Parameters:

  • entry (Object)

    the entry to get the key for

Returns:

  • (Object)

    the passed in entry



188
189
190
# File 'lib/dm-core/support/ordered_set.rb', line 188

def key_for(entry)
  entry
end

#valid?(entry) ⇒ true

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Tests if the given entry qualifies to be added to the cache

Parameters:

  • entry (Object)

    the entry to be checked

Returns:

  • (true)

    true



175
176
177
# File 'lib/dm-core/support/ordered_set.rb', line 175

def valid?(entry)
  true
end