Class: UniProp::BlockValueGroup

Inherits:
Object
  • Object
show all
Includes:
ValueGroup
Defined in:
lib/uniprop/value_group.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ValueGroup

#codepoints, #values_of, #values_to_codepoints

Constructor Details

#initialize(propfile, block_no) ⇒ BlockValueGroup

propfile内の特定のブロックのcodeopintと値の対応を管理するためのオブジェクトを生成

Parameters:

  • propfile (PropFile)
  • block_no (Integer)

    一番最初のブロックを0とした時の、ブロックの番号



258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
# File 'lib/uniprop/value_group.rb', line 258

def initialize(propfile, block_no)
  @propfile = propfile
   = @propfile.version..(@propfile)
  
  block_range = .blocks[block_no].range
  codepoint_col_no = .codepoint_column_nos[block_no]

  @propfile.shaped_lines[block_range].each do |shaped_line|
    shaped_line_dup = shaped_line.dup
    codepoint = shaped_line_dup.delete_at(codepoint_col_no)
    values = shaped_line_dup

    if codepoint && values
      add_values(codepoint, values)
    end
  end
end

Instance Attribute Details

#propfileObject (readonly)

Returns the value of attribute propfile.



253
254
255
# File 'lib/uniprop/value_group.rb', line 253

def propfile
  @propfile
end