Sha256: 3024c1b5270063d310df5e558af300a1ef4fd5a50f549b086674b6af681816ad

Contents?: true

Size: 454 Bytes

Versions: 1

Compression:

Stored size: 454 Bytes

Contents

module Polyfill
  module V2_4
    module Array
      module Concat
        module Method
          def concat(*others)
            return super if others.length == 1

            acc = [].concat(self)
            others.each do |other|
              acc.concat(other)
            end

            replace(acc)
          end if RUBY_VERSION < '2.4.0'
        end

        refine ::Array do
          include Method
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
polyfill-0.1.0 lib/polyfill/v2_4/array/concat.rb