lib/memory_model/collection/index/unique.rb
# `create` should implement creating a new record, raising an error if an item with the matching storage id already
# exists in the index.
`create` should implement creating a new record, raising an error if an item with the matching storage id already
exists in the index.
` create ` should implement creating a new record raising an error if an item with the matching storage id already exists in the index .
def create(key, item)
          raise(NilValueError, self) if key.nil? && !options[:allow_nil]
          raise(RecordNotUniqueError, [self, key]) if index.has_key?(key)
          return if key.nil?
          index[key] = item
        end
def create ( key , item ) raise ( NilValueError , self ) if key . nil? && ! options [ :allow_nil ] raise ( RecordNotUniqueError , [ self , key ] ) if index . has_key? ( key ) return if key . nil? index [ key ] = item end
`create` should implement creating a new record, raising an error if an item with the matching storage id already
exists in the index.
` create ` should implement creating a new record raising an error if an item with the matching storage id already exists in the index .
key
<not_specific>
item
<not_specific>