lib/stringex/unidecoder.rb in stringex-2.5.2 vs lib/stringex/unidecoder.rb in stringex-2.6.0
- old
+ new
@@ -1,8 +1,9 @@
# encoding: UTF-8
require 'yaml'
+require 'stringex/localization'
module Stringex
module Unidecoder
# Contains Unicode codepoints, loading as needed from YAML files
CODEPOINTS = Hash.new{|h, k|
@@ -66,14 +67,16 @@
end
end
end
module Stringex
- module StringExtensions::PublicInstanceMethods
- # Returns string with its UTF-8 characters transliterated to ASCII ones. Example:
- #
- # "⠋⠗⠁⠝⠉⠑".to_ascii #=> "france"
- def to_ascii
- Stringex::Unidecoder.decode(self)
+ module StringExtensions
+ module PublicInstanceMethods
+ # Returns string with its UTF-8 characters transliterated to ASCII ones. Example:
+ #
+ # "⠋⠗⠁⠝⠉⠑".to_ascii #=> "france"
+ def to_ascii
+ Stringex::Unidecoder.decode(self)
+ end
end
end
end