Sha256: bf23547b270867b72dae721ce1da0bcb53507bfb3f6537c69df7b180ba74769f

Contents?: true

Size: 347 Bytes

Versions: 14

Compression:

Stored size: 347 Bytes

Contents

module LinkThumbnailer
  class Model

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

    private

    def sanitize(str)
      return unless str

      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

14 entries across 14 versions & 1 rubygems

Version Path
link_thumbnailer-3.3.1 lib/link_thumbnailer/model.rb
link_thumbnailer-3.3.0 lib/link_thumbnailer/model.rb
link_thumbnailer-3.2.1 lib/link_thumbnailer/model.rb
link_thumbnailer-3.2.0 lib/link_thumbnailer/model.rb
link_thumbnailer-3.1.2 lib/link_thumbnailer/model.rb
link_thumbnailer-3.1.1 lib/link_thumbnailer/model.rb
link_thumbnailer-3.1.0 lib/link_thumbnailer/model.rb
link_thumbnailer-3.0.3 lib/link_thumbnailer/model.rb
link_thumbnailer-3.0.2 lib/link_thumbnailer/model.rb
link_thumbnailer-3.0.1 lib/link_thumbnailer/model.rb
link_thumbnailer-3.0.0 lib/link_thumbnailer/model.rb
link_thumbnailer-2.6.1 lib/link_thumbnailer/model.rb
link_thumbnailer-2.6.0 lib/link_thumbnailer/model.rb
link_thumbnailer-2.5.2 lib/link_thumbnailer/model.rb