Class: Ucode::Parsers::ExtractedProperties::Tuple

Inherits:
Struct
  • Object
show all
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

Instance Method Summary collapse

Instance Attribute Details

#range_firstObject

Returns the value of attribute range_first

Returns:

  • (Object)

    the current value of range_first



28
29
30
# File 'lib/ucode/parsers/extracted_properties.rb', line 28

def range_first
  @range_first
end

#range_lastObject

Returns the value of attribute range_last

Returns:

  • (Object)

    the current value of range_last



28
29
30
# File 'lib/ucode/parsers/extracted_properties.rb', line 28

def range_last
  @range_last
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



28
29
30
# File 'lib/ucode/parsers/extracted_properties.rb', line 28

def value
  @value
end

Instance Method Details

#cp_idsObject

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

#rangeObject

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

Returns:

  • (Boolean)


39
40
41
# File 'lib/ucode/parsers/extracted_properties.rb', line 39

def single?
  range_first == range_last
end