lib/characteristics.rb in characteristics-0.3.1 vs lib/characteristics.rb in characteristics-0.4.0

- old
+ new

@@ -1,5 +1,7 @@ +# frozen_string_literal: true + require_relative "characteristics/version" require_relative "characteristics/ascii" require_relative "characteristics/binary" require_relative "characteristics/byte" @@ -10,11 +12,11 @@ case encoding_name when "US-ASCII" :ascii when "ASCII-8BIT" :binary - when /^UTF-/ + when /^UTF-?/ :unicode when /^ISO-8859-/, /^Windows-125/, /^(IBM|CP85)/, /^mac/, 'TIS-620', 'Windows-874', /^KOI8-/ :byte else raise ArgumentError, "encoding <#{encoding_name}> not supported" @@ -63,7 +65,45 @@ def blank? end def format? + end + + # private use emojis + def kddi? + end + + # private use emojis + def softbank? + end + + # private use emojis + def docomo? + end + + private + + def encoding_has_kddi? + @encoding_name.end_with? "KDDI" + end + + def encoding_has_softbank? + @encoding_name.end_with? "SoftBank" + end + + def encoding_has_docomo? + @encoding_name.end_with? "DoCoMo" + end + + def encoding_has_c0? + true + end + + def encoding_has_delete? + true + end + + def encoding_has_c1? + false end end