Class: Ucode::Parsers::ExtractedProperties::Tuple
- Inherits:
-
Struct
- Object
- Struct
- Ucode::Parsers::ExtractedProperties::Tuple
- Defined in:
- lib/ucode/parsers/extracted_properties.rb
Overview
Lightweight record yielded by ‘.each_record`. The Coordinator consumes these immediately; no need for full lutaml-model overhead. Members are named `range_first` / `range_last` (not `first` / `last`) to avoid overriding `Enumerable#first`.
Instance Attribute Summary collapse
-
#range_first ⇒ Object
Returns the value of attribute range_first.
-
#range_last ⇒ Object
Returns the value of attribute range_last.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#cp_ids ⇒ Object
Enumerator over every codepoint id in this tuple’s range.
-
#range ⇒ Object
The inclusive Range of codepoints this assignment covers.
- #single? ⇒ Boolean
Instance Attribute Details
#range_first ⇒ Object
Returns the value of attribute range_first
28 29 30 |
# File 'lib/ucode/parsers/extracted_properties.rb', line 28 def range_first @range_first end |
#range_last ⇒ Object
Returns the value of attribute range_last
28 29 30 |
# File 'lib/ucode/parsers/extracted_properties.rb', line 28 def range_last @range_last end |
#value ⇒ Object
Returns the value of attribute value
28 29 30 |
# File 'lib/ucode/parsers/extracted_properties.rb', line 28 def value @value end |
Instance Method Details
#cp_ids ⇒ Object
Enumerator over every codepoint id in this tuple’s range.
35 36 37 |
# File 'lib/ucode/parsers/extracted_properties.rb', line 35 def cp_ids (range_first..range_last).map { |cp| format("U+%04X", cp) } end |
#range ⇒ Object
The inclusive Range of codepoints this assignment covers.
30 31 32 |
# File 'lib/ucode/parsers/extracted_properties.rb', line 30 def range Range.new(range_first, range_last) end |
#single? ⇒ Boolean
39 40 41 |
# File 'lib/ucode/parsers/extracted_properties.rb', line 39 def single? range_first == range_last end |