Sha256: a798965e8c6b0852e4f88eb916fc9c06b1c684fd722960368dbe7ea86651b62a

Contents?: true

Size: 514 Bytes

Versions: 1

Compression:

Stored size: 514 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

        if RUBY_VERSION < '2.4.0'
          refine ::String do
            include Method
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
polyfill-0.2.0 lib/polyfill/v2_4/string/prepend.rb