Class: Ucode::Unicode::Block
- Inherits:
-
Struct
- Object
- Struct
- Ucode::Unicode::Block
- Defined in:
- lib/ucode/unicode/block.rb
Overview
A Unicode block — a contiguous range of codepoints with a name. There are ~346 blocks in Unicode 17.0.0.
Pure value object like Plane. The id field uses the underscore
form (e.g., "Basic_Latin") for filesystem/JSON key compatibility;
the name field preserves the original Unicode spelling.
Instance Attribute Summary collapse
-
#first_cp ⇒ Object
Returns the value of attribute first_cp.
-
#id ⇒ Object
Returns the value of attribute id.
-
#last_cp ⇒ Object
Returns the value of attribute last_cp.
-
#name ⇒ Object
Returns the value of attribute name.
-
#plane_number ⇒ Object
Returns the value of attribute plane_number.
Instance Method Summary collapse
Instance Attribute Details
#first_cp ⇒ Object
Returns the value of attribute first_cp
11 12 13 |
# File 'lib/ucode/unicode/block.rb', line 11 def first_cp @first_cp end |
#id ⇒ Object
Returns the value of attribute id
11 12 13 |
# File 'lib/ucode/unicode/block.rb', line 11 def id @id end |
#last_cp ⇒ Object
Returns the value of attribute last_cp
11 12 13 |
# File 'lib/ucode/unicode/block.rb', line 11 def last_cp @last_cp end |
#name ⇒ Object
Returns the value of attribute name
11 12 13 |
# File 'lib/ucode/unicode/block.rb', line 11 def name @name end |
#plane_number ⇒ Object
Returns the value of attribute plane_number
11 12 13 |
# File 'lib/ucode/unicode/block.rb', line 11 def plane_number @plane_number end |
Instance Method Details
#cover?(codepoint) ⇒ Boolean
23 24 25 |
# File 'lib/ucode/unicode/block.rb', line 23 def cover?(codepoint) range.cover?(codepoint) end |
#range ⇒ Object
19 20 21 |
# File 'lib/ucode/unicode/block.rb', line 19 def range (first_cp..last_cp) end |