Sha256: 167d1b8f43702af73910116741498d741a8e9d8d2498edd76b3475e977e40a40

Contents?: true

Size: 265 Bytes

Versions: 176

Compression:

Stored size: 265 Bytes

Contents

module Tins
  module HashUnion
    def |(other)
      case
      when other.respond_to?(:to_hash)
        other = other.to_hash
      when other.respond_to?(:to_h)
        other = other.to_h
      end
      other.merge(self)
    end
  end
end

require 'tins/alias'

Version data entries

176 entries across 158 versions & 9 rubygems

Version Path
tdiary-5.1.2 vendor/bundle/ruby/2.6.0/gems/tins-0.13.2/lib/tins/hash_union.rb
tins-1.25.0 lib/tins/hash_union.rb
tdiary-5.1.1 vendor/bundle/ruby/2.6.0/gems/tins-0.13.2/lib/tins/hash_union.rb
tdiary-5.1.1 vendor/bundle/ruby/2.7.0/gems/tins-1.24.1/lib/tins/hash_union.rb
tins-1.24.1 lib/tins/hash_union.rb
tins-1.24.0 lib/tins/hash_union.rb
tins-1.23.0 lib/tins/hash_union.rb
tdiary-5.1.0 vendor/bundle/gems/tins-1.22.2/lib/tins/hash_union.rb
tins-1.22.2 lib/tins/hash_union.rb
tins-1.22.1 lib/tins/hash_union.rb
tins-1.22.0 lib/tins/hash_union.rb
tins-1.21.1 lib/tins/hash_union.rb
tins-1.21.0 lib/tins/hash_union.rb
tins-1.20.3 lib/tins/hash_union.rb
tdiary-5.0.13 vendor/bundle/gems/tins-1.20.2/lib/tins/hash_union.rb
tdiary-5.0.12.1 vendor/bundle/gems/tins-1.20.2/lib/tins/hash_union.rb
tdiary-5.0.11 vendor/bundle/gems/tins-1.16.3/lib/tins/hash_union.rb
tdiary-5.0.11 vendor/bundle/gems/tins-1.20.2/lib/tins/hash_union.rb
tins-1.20.2 lib/tins/hash_union.rb
tins-1.20.1 lib/tins/hash_union.rb