Top Level Namespace
Defined Under Namespace
Modules: Analects Classes: CJKChar, CJKString, Cedict, CreateCedictTable, PopulateCedictTable
Instance Method Summary collapse
Instance Method Details
#CJKChar(str) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/cjk_string.rb', line 35 def CJKChar(str) return str if str.is_a? CJKChar if str.length > 1 if str =~ /^(U\+)?([0-9A-Fa-f]+)/ str = [$2].pack('U') else raise ArgumentError, 'CJKChar must have length one' end end CJKChar.new(str) end |