Sha256: 3fa459a3193dba6905b56afa8a45ded4f0246024f0cff5cedf7ce5d121ccacfb

Contents?: true

Size: 533 Bytes

Versions: 20

Compression:

Stored size: 533 Bytes

Contents

# frozen_string_literal: true

RubyNext::Core.patch Array, method: :deconstruct, version: "2.7" do
  <<-RUBY
def deconstruct
  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: Array, name: "ArrayRespondToDeconstruct", method: :deconstruct, version: "2.7" do
    <<-RUBY
def respond_to?(mid, *)
  return true if mid == :deconstruct
  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/array/deconstruct.rb
ruby-next-core-1.1.0 lib/ruby-next/core/array/deconstruct.rb
ruby-next-core-1.0.3 lib/ruby-next/core/array/deconstruct.rb
ruby-next-core-1.0.2 lib/ruby-next/core/array/deconstruct.rb
ruby-next-core-1.0.1 lib/ruby-next/core/array/deconstruct.rb
ruby-next-core-1.0.0 lib/ruby-next/core/array/deconstruct.rb
ruby-next-core-1.0.0.rc.1 lib/ruby-next/core/array/deconstruct.rb
ruby-next-core-0.15.3 lib/ruby-next/core/array/deconstruct.rb
ruby-next-core-0.15.2 lib/ruby-next/core/array/deconstruct.rb
ruby-next-core-0.15.1 lib/ruby-next/core/array/deconstruct.rb
ruby-next-core-0.15.0 lib/ruby-next/core/array/deconstruct.rb
ruby-next-core-0.14.1 lib/ruby-next/core/array/deconstruct.rb
ruby-next-core-0.14.0 lib/ruby-next/core/array/deconstruct.rb
ruby-next-core-0.13.3 lib/ruby-next/core/array/deconstruct.rb
ruby-next-core-0.13.2 lib/ruby-next/core/array/deconstruct.rb
ruby-next-core-0.13.1 lib/ruby-next/core/array/deconstruct.rb
ruby-next-core-0.13.0 lib/ruby-next/core/array/deconstruct.rb
ruby-next-core-0.12.0 lib/ruby-next/core/array/deconstruct.rb
ruby-next-core-0.11.1 lib/ruby-next/core/array/deconstruct.rb
ruby-next-core-0.11.0 lib/ruby-next/core/array/deconstruct.rb