Module: Utf8Sanitizer

Defined in:
lib/utf8_sanitizer.rb,
lib/utf8_sanitizer/utf.rb,
lib/utf8_sanitizer/version.rb

Overview

require ‘pry’

Defined Under Namespace

Classes: UTF

Constant Summary collapse

VERSION =
'2.17'

Class Method Summary collapse

Class Method Details

.sanitize(args = {}) ⇒ Object

Args must include :data or :file_path, else seeds will run by default.



7
8
9
10
11
12
# File 'lib/utf8_sanitizer.rb', line 7

def self.sanitize(args = {})
  input = { stats: nil, file_path: nil, data: nil }.merge(args)

  return input unless input.compact.any?
  sanitized_data = input.merge(Utf8Sanitizer::UTF.new.validate_data(input))
end