Sha256: 956831b63c7b378db28147c649a2349133d0483601b23225f053ae2bca054d84

Contents?: true

Size: 381 Bytes

Versions: 1

Compression:

Stored size: 381 Bytes

Contents

# frozen_string_literal: true

module LinkThumbnailer
  class Model

    def to_json(*args)
      as_json.to_json(*args)
    end

    private

    def sanitize(str)
      return unless str

      str = str.dup
      str.encode!("UTF-16", "UTF-8", invalid: :replace, undef: :replace, replace: "")
      str.encode!("UTF-8", "UTF-16").strip.gsub(/[\r\n\f]+/, "\n")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
link_thumbnailer-3.3.2 lib/link_thumbnailer/model.rb