Sha256: 3b4d7a60a203c875382cf43f7c67c808f07da6b20fed6ba202c61251b133971c

Contents?: true

Size: 374 Bytes

Versions: 14

Compression:

Stored size: 374 Bytes

Contents

# frozen_string_literal: true

# This provides String#delete_suffix? for Ruby 2.4.
unless String.method_defined?(:delete_suffix)
  class CSV
    module DeleteSuffix
      refine String do
        def delete_suffix(suffix)
          if end_with?(suffix)
            self[0...-suffix.size]
          else
            self
          end
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
csv-3.2.3 lib/csv/delete_suffix.rb
csv-3.2.2 lib/csv/delete_suffix.rb
csv-3.2.1 lib/csv/delete_suffix.rb
csv-3.2.0 lib/csv/delete_suffix.rb
csv-3.1.9 lib/csv/delete_suffix.rb
csv-3.1.8 lib/csv/delete_suffix.rb
csv-3.1.7 lib/csv/delete_suffix.rb
csv-3.1.6 lib/csv/delete_suffix.rb
csv-3.1.5 lib/csv/delete_suffix.rb
csv-3.1.4 lib/csv/delete_suffix.rb
csv-3.1.3 lib/csv/delete_suffix.rb
csv-3.1.2 lib/csv/delete_suffix.rb
csv-3.1.1 lib/csv/delete_suffix.rb
csv-3.1.0 lib/csv/delete_suffix.rb