Sha256: 2e36e339956dc6eead1aa57c5e0daca6b797ce3d9f9ac348333130e24a37c193

Contents?: true

Size: 270 Bytes

Versions: 20

Compression:

Stored size: 270 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

20 entries across 19 versions & 2 rubygems

Version Path
facets-glimmer-3.2.0 lib/core/facets/hash/insert.rb
facets-3.1.0 lib/core/facets/hash/insert.rb
facets-3.0.0 lib/core/facets/hash/insert.rb
facets-2.9.3 lib/core/facets/hash/insert.rb
facets-2.9.2 lib/core/facets/hash/insert.rb
facets-2.9.2 src/core/facets/hash/insert.rb
facets-2.9.1 lib/core/facets/hash/insert.rb
facets-2.9.0 lib/core/facets/hash/insert.rb
facets-2.9.0.pre.2 lib/core/facets/hash/insert.rb
facets-2.9.0.pre.1 lib/core/facets/hash/insert.rb
facets-2.8.4 lib/core/facets/hash/insert.rb
facets-2.8.3 lib/core/facets/hash/insert.rb
facets-2.8.2 lib/core/facets/hash/insert.rb
facets-2.8.1 lib/core/facets/hash/insert.rb
facets-2.8.0 lib/core/facets/hash/insert.rb
facets-2.7.0 lib/core/facets/hash/insert.rb
facets-2.6.0 lib/core/facets/hash/insert.rb
facets-2.5.0 lib/core/facets/hash/insert.rb
facets-2.5.1 lib/core/facets/hash/insert.rb
facets-2.5.2 lib/core/facets/hash/insert.rb