Module: Utf8Proc::StringExtensions
- Included in:
- String
- Defined in:
- lib/utf8proc.rb
Instance Method Summary collapse
- #char_ary ⇒ Object
- #utf8chars ⇒ Object
- #utf8map(*option_array) ⇒ Object
- #utf8map!(*option_array) ⇒ Object
- #utf8nfc ⇒ Object
- #utf8nfc! ⇒ Object
- #utf8nfd ⇒ Object
- #utf8nfd! ⇒ Object
- #utf8nfkc ⇒ Object
- #utf8nfkc! ⇒ Object
- #utf8nfkd ⇒ Object
- #utf8nfkd! ⇒ Object
Instance Method Details
#char_ary ⇒ Object
90 91 92 93 |
# File 'lib/utf8proc.rb', line 90 def char_ary # depecated, use String#utf8chars instead utf8chars end |
#utf8chars ⇒ Object
85 86 87 88 89 |
# File 'lib/utf8proc.rb', line 85 def utf8chars result = self.utf8map(:charbound).split("\377") result.shift if result.first == "" result end |
#utf8map(*option_array) ⇒ Object
64 65 66 67 68 69 70 71 72 73 |
# File 'lib/utf8proc.rb', line 64 def utf8map(*option_array) = 0 option_array.each do |option| flag = Utf8Proc::Options[option] raise ArgumentError, "Unknown argument given to String#utf8map." unless flag |= flag end return Utf8Proc::utf8map(self, ) end |
#utf8map!(*option_array) ⇒ Object
74 75 76 |
# File 'lib/utf8proc.rb', line 74 def utf8map!(*option_array) self.replace(self.utf8map(*option_array)) end |
#utf8nfc ⇒ Object
79 |
# File 'lib/utf8proc.rb', line 79 def utf8nfc; utf8map( :stable, :compose); end |
#utf8nfc! ⇒ Object
80 |
# File 'lib/utf8proc.rb', line 80 def utf8nfc!; utf8map!(:stable, :compose); end |
#utf8nfd ⇒ Object
77 |
# File 'lib/utf8proc.rb', line 77 def utf8nfd; utf8map( :stable, :decompose); end |
#utf8nfd! ⇒ Object
78 |
# File 'lib/utf8proc.rb', line 78 def utf8nfd!; utf8map!(:stable, :decompose); end |
#utf8nfkc ⇒ Object
83 |
# File 'lib/utf8proc.rb', line 83 def utf8nfkc; utf8map( :stable, :compose, :compat); end |
#utf8nfkc! ⇒ Object
84 |
# File 'lib/utf8proc.rb', line 84 def utf8nfkc!; utf8map!(:stable, :compose, :compat); end |
#utf8nfkd ⇒ Object
81 |
# File 'lib/utf8proc.rb', line 81 def utf8nfkd; utf8map( :stable, :decompose, :compat); end |
#utf8nfkd! ⇒ Object
82 |
# File 'lib/utf8proc.rb', line 82 def utf8nfkd!; utf8map!(:stable, :decompose, :compat); end |