Sha256: 7d78601b715924dffacfb05b89148afbb11ba44a5fd63750c5c0b8fe3c0403f0

Contents?: true

Size: 571 Bytes

Versions: 3

Compression:

Stored size: 571 Bytes

Contents

module Polyfill
  module V2_4
    module Array
      module Instance
        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
          end

          refine ::Array do
            include Method
          end

          def self.included(base)
            base.include Method
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
polyfill-0.6.0 lib/polyfill/v2_4/array/instance/concat.rb
polyfill-0.5.0 lib/polyfill/v2_4/array/instance/concat.rb
polyfill-0.4.0 lib/polyfill/v2_4/array/instance/concat.rb