Class: CJKString

Inherits:
String
  • Object
show all
Defined in:
lib/cjk_string.rb

Instance Method Summary collapse

Instance Method Details

#all_cjk?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/cjk_string.rb', line 10

def all_cjk?
  length == cjk_chars.length
end

#any_cjk?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/cjk_string.rb', line 14

def any_cjk?
  cjk_chars.length > 1
end

#cjk_charsObject



2
3
4
# File 'lib/cjk_string.rb', line 2

def cjk_chars
  @cjk_chars ||= scan(Analects::Models::Zi::REGEXP)
end

#one_cjk?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/cjk_string.rb', line 6

def one_cjk?
  cjk_chars.length == 1
end