Sha256: cf9a8621b3a4b5edeb8a7205d870adaac46e56347bb52b6f3569cd086a75e24a

Contents?: true

Size: 272 Bytes

Versions: 3

Compression:

Stored size: 272 Bytes

Contents

class Hash

  # As with #store but only if the key isn't
  # already in the hash.
  #
  # TODO: Would #store? be a better name?
  #
  #   CREDIT: Trans

  def insert(name, value)
    if key?(name)
      false
    else
      store(name,value)
      true
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
facets-2.2.0 lib/core/facets/hash/insert.rb
facets-2.2.1 lib/core/facets/hash/insert.rb
facets-2.3.0 lib/core/facets/hash/insert.rb