Class: Unicoder::Builder::Blocks

Inherits:
Object
  • Object
show all
Includes:
Unicoder::Builder
Defined in:
lib/unicoder/builders/blocks.rb

Instance Attribute Summary

Attributes included from Unicoder::Builder

#formats, #index, #option

Instance Method Summary collapse

Methods included from Unicoder::Builder

#assign, #assign_codepoint, build, #export, #initialize, #meta, #parse_file

Instance Method Details

#initialize_indexObject



6
7
8
# File 'lib/unicoder/builders/blocks.rb', line 6

def initialize_index
  @index = []
end

#parse!Object



10
11
12
13
14
# File 'lib/unicoder/builders/blocks.rb', line 10

def parse!
  parse_file :blocks, :line, regex: /^(?<from>\S+?)\.\.(?<to>\S+);\s(?<name>.+)$/ do |line|
    @index << [line["from"].to_i(16), line["to"].to_i(16), line["name"]]
  end
end