Class: UnicodeScriptDetector::ScriptGroup
- Inherits:
-
Object
- Object
- UnicodeScriptDetector::ScriptGroup
- Defined in:
- lib/unicode_script_detector/script_group.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#script ⇒ Object
readonly
Returns the value of attribute script.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
- #characters ⇒ Object
-
#initialize(script, chars, name) ⇒ ScriptGroup
constructor
A new instance of ScriptGroup.
- #length ⇒ Object
Constructor Details
#initialize(script, chars, name) ⇒ ScriptGroup
Returns a new instance of ScriptGroup.
5 6 7 8 9 10 |
# File 'lib/unicode_script_detector/script_group.rb', line 5 def initialize(script, chars, name) @script = script @chars = chars @text = chars.join @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/unicode_script_detector/script_group.rb', line 3 def name @name end |
#script ⇒ Object (readonly)
Returns the value of attribute script.
3 4 5 |
# File 'lib/unicode_script_detector/script_group.rb', line 3 def script @script end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
3 4 5 |
# File 'lib/unicode_script_detector/script_group.rb', line 3 def text @text end |
Instance Method Details
#characters ⇒ Object
16 17 18 |
# File 'lib/unicode_script_detector/script_group.rb', line 16 def characters @characters ||= @chars.map { |char| Character.new(char, @script, @name) } end |
#length ⇒ Object
12 13 14 |
# File 'lib/unicode_script_detector/script_group.rb', line 12 def length @chars.length end |