Class: UnicodedataRb::Codepoint

Inherits:
Struct
  • Object
show all
Defined in:
lib/unicodedata_rb/codepoint.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Codepoint

Returns a new instance of Codepoint.



14
15
16
17
18
# File 'lib/unicodedata_rb/codepoint.rb', line 14

def initialize(*args)
  super
  self.codepoint = self.codepoint.to_i(16)
  NUMERIC_FIELDS.each { |f| send("#{f}=", send(f).to_r) }
end

Class Method Details

.from_line(line) ⇒ Object



20
21
22
# File 'lib/unicodedata_rb/codepoint.rb', line 20

def self.from_line(line)
  new *(line.chomp.split ';')
end