Sha256: e7260a91920c12d8f195e56101aad4b6f2ffde5b2e39ea2ca229a43d66da89d1

Contents?: true

Size: 250 Bytes

Versions: 7

Compression:

Stored size: 250 Bytes

Contents

# frozen_string_literal: true

module Kiev
  module Util
    def self.sanitize(value)
      return unless value
      value.gsub(/[^\w\-]/, "")[0...255]
    end

    def self.to_http(value)
      "HTTP_#{value.tr('-', '_').upcase}"
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
kiev-4.3.0 lib/kiev/util.rb
kiev-4.2.0 lib/kiev/util.rb
kiev-4.1.0 lib/kiev/util.rb
kiev-4.0.0 lib/kiev/util.rb
kiev-3.0.0 lib/kiev/util.rb
kiev-2.8.0 lib/kiev/util.rb
kiev-2.7.3 lib/kiev/util.rb