Sha256: 4138630e6a9786b7f438f9088fa446cb1fc12f35c6b17afdd25df0d5f68500db

Contents?: true

Size: 462 Bytes

Versions: 1

Compression:

Stored size: 462 Bytes

Contents

module Polyfill
  module V2_4
    module String
      module Prepend
        module Method
          def prepend(*others)
            return super if others.length == 1

            acc = '' << self
            others.reverse_each do |other|
              acc.prepend(other)
            end

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

        refine ::String 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/string/prepend.rb