Class: Ucode::Parsers::Unihan::Record

Inherits:
Struct
  • Object
show all
Defined in:
lib/ucode/parsers/unihan.rb

Overview

Stream record: one Unihan line. Internal pipeline data — a Struct avoids lutaml-model ceremony for transient values. The final UnihanEntry model carries the merged, persisted shape. The member is field_values (not values) to avoid overriding Struct#values (the array of all member values).

category is the symbol UnihanEntry uses to bucket the field into its category attribute (readings / variants / etc.). Set by each_in_dir from the source filename via FILE_TO_CATEGORY.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#categoryObject

Returns the value of attribute category

Returns:

  • (Object)

    the current value of category



65
66
67
# File 'lib/ucode/parsers/unihan.rb', line 65

def category
  @category
end

#cpObject

Returns the value of attribute cp

Returns:

  • (Object)

    the current value of cp



65
66
67
# File 'lib/ucode/parsers/unihan.rb', line 65

def cp
  @cp
end

#fieldObject

Returns the value of attribute field

Returns:

  • (Object)

    the current value of field



65
66
67
# File 'lib/ucode/parsers/unihan.rb', line 65

def field
  @field
end

#field_valuesObject

Returns the value of attribute field_values

Returns:

  • (Object)

    the current value of field_values



65
66
67
# File 'lib/ucode/parsers/unihan.rb', line 65

def field_values
  @field_values
end

Instance Method Details

#cp_idObject



66
67
68
# File 'lib/ucode/parsers/unihan.rb', line 66

def cp_id
  format("U+%04X", cp)
end