Sha256: 4b42ab307a02fd9ff6254e2877185bca8308532424afba73dc670912d30f4e17

Contents?: true

Size: 270 Bytes

Versions: 10

Compression:

Stored size: 270 Bytes

Contents

class Hash

  # Like merge operator '+' but merges in reverse order.
  #
  #   h1 = { :a=>1 }
  #   h2 = { :a=>2, :b=>3 }
  #
  #   h1 + h2  #=> { :a=>2, :b=>3 }
  #   h1 * h2  #=> { :a=>1, :b=>3 }
  #
  # CREDIT: Trans

  def *(other)
    other.merge(self)
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
facets-2.8.4 lib/core/facets/hash/op_mul.rb
facets-2.8.3 lib/core/facets/hash/op_mul.rb
facets-2.8.2 lib/core/facets/hash/op_mul.rb
facets-2.8.1 lib/core/facets/hash/op_mul.rb
facets-2.8.0 lib/core/facets/hash/op_mul.rb
facets-2.7.0 lib/core/facets/hash/op_mul.rb
facets-2.6.0 lib/core/facets/hash/op_mul.rb
facets-2.5.0 lib/core/facets/hash/op_mul.rb
facets-2.5.1 lib/core/facets/hash/op_mul.rb
facets-2.5.2 lib/core/facets/hash/op_mul.rb