Sha256: a95dc575acb71e0bb9f9d77aedc1f1120980f2760d448f75beb547864cf47964

Contents?: true

Size: 557 Bytes

Versions: 20

Compression:

Stored size: 557 Bytes

Contents

# frozen_string_literal: true

RubyNext::Core.patch Hash, method: :deconstruct_keys, version: "2.7" do
  <<-RUBY
def deconstruct_keys(_)
  self
end
  RUBY
end

# We need to hack `respond_to?` in Ruby 2.5, since it's not working with refinements
if Gem::Version.new(::RubyNext.current_ruby_version) < Gem::Version.new("2.6")
  RubyNext::Core.patch refineable: Hash, name: "HashRespondToDeconstructKeys", method: :deconstruct_keys, version: "2.7" do
    <<-RUBY
def respond_to?(mid, *)
  return true if mid == :deconstruct_keys
  super
end
    RUBY
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
ruby-next-core-1.1.1 lib/ruby-next/core/hash/deconstruct_keys.rb
ruby-next-core-1.1.0 lib/ruby-next/core/hash/deconstruct_keys.rb
ruby-next-core-1.0.3 lib/ruby-next/core/hash/deconstruct_keys.rb
ruby-next-core-1.0.2 lib/ruby-next/core/hash/deconstruct_keys.rb
ruby-next-core-1.0.1 lib/ruby-next/core/hash/deconstruct_keys.rb
ruby-next-core-1.0.0 lib/ruby-next/core/hash/deconstruct_keys.rb
ruby-next-core-1.0.0.rc.1 lib/ruby-next/core/hash/deconstruct_keys.rb
ruby-next-core-0.15.3 lib/ruby-next/core/hash/deconstruct_keys.rb
ruby-next-core-0.15.2 lib/ruby-next/core/hash/deconstruct_keys.rb
ruby-next-core-0.15.1 lib/ruby-next/core/hash/deconstruct_keys.rb
ruby-next-core-0.15.0 lib/ruby-next/core/hash/deconstruct_keys.rb
ruby-next-core-0.14.1 lib/ruby-next/core/hash/deconstruct_keys.rb
ruby-next-core-0.14.0 lib/ruby-next/core/hash/deconstruct_keys.rb
ruby-next-core-0.13.3 lib/ruby-next/core/hash/deconstruct_keys.rb
ruby-next-core-0.13.2 lib/ruby-next/core/hash/deconstruct_keys.rb
ruby-next-core-0.13.1 lib/ruby-next/core/hash/deconstruct_keys.rb
ruby-next-core-0.13.0 lib/ruby-next/core/hash/deconstruct_keys.rb
ruby-next-core-0.12.0 lib/ruby-next/core/hash/deconstruct_keys.rb
ruby-next-core-0.11.1 lib/ruby-next/core/hash/deconstruct_keys.rb
ruby-next-core-0.11.0 lib/ruby-next/core/hash/deconstruct_keys.rb