Class: UnicodeScriptDetector::Character

Inherits:
Object
  • Object
show all
Defined in:
lib/unicode_script_detector/character.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(char, script, name) ⇒ Character

Returns a new instance of Character.



5
6
7
8
9
# File 'lib/unicode_script_detector/character.rb', line 5

def initialize(char, script, name)
  @char = char
  @script = script
  @name = name
end

Instance Attribute Details

#charObject (readonly)

Returns the value of attribute char.



3
4
5
# File 'lib/unicode_script_detector/character.rb', line 3

def char
  @char
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/unicode_script_detector/character.rb', line 3

def name
  @name
end

#scriptObject (readonly)

Returns the value of attribute script.



3
4
5
# File 'lib/unicode_script_detector/character.rb', line 3

def script
  @script
end

Instance Method Details

#hiragana?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/unicode_script_detector/character.rb', line 15

def hiragana?
  @script === :Hiragana
end

#latin?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/unicode_script_detector/character.rb', line 11

def latin?
  @script === :Latin
end