Methods
#
C
F
H
I
L
N
R
S
T
Class Public methods
new(row, cell=nil)
# File tool/jisx0208.rb, line 20
def initialize(row, cell=nil)
  if cell
    @code = row_cell_to_code(row, cell)
  else
    @code = row.to_int
  end
end
Instance Public methods
==(other)
# File tool/jisx0208.rb, line 28
def ==(other)
  if self.class === other
    return Integer(self) == Integer(other)
  end
  return super(other)
end
cell()
# File tool/jisx0208.rb, line 51
def cell
  self.lo - 0x20
end
from_sjis(sjis)
# File tool/jisx0208.rb, line 4
def from_sjis(sjis)
  unless 0x8140 <= sjis && sjis <= 0xFCFC
    raise ArgumentError, "out of the range of JIS X 0208: 0x#{sjis.to_s(16)}"
  end
  sjis_hi, sjis_lo = sjis >> 8, sjis & 0xFF
  sjis_hi = (sjis_hi - ((sjis_hi <= 0x9F) ? 0x80 : 0xC0)) << 1
  if sjis_lo <= 0x9E
    sjis_hi -= 1
    sjis_lo -= (sjis_lo <= 0x7E) ? 0x3F : 0x40
  else
    sjis_lo -= 0x9E
  end
  return self.new(sjis_hi, sjis_lo)
end
hi()
# File tool/jisx0208.rb, line 39
def hi
  Integer(self) >> 8
end
inspect()
# File tool/jisx0208.rb, line 71
def inspect
  "#<JISX0208::Char:#{self.object_id.to_s(16)} sjis=#{self.to_sjis.to_s(16)} jis=#{self.to_int.to_s(16)}>"
end
lo()
# File tool/jisx0208.rb, line 43
def lo
  Integer(self) & 0xFF
end
row()
# File tool/jisx0208.rb, line 47
def row
  self.hi - 0x20
end
succ()
# File tool/jisx0208.rb, line 55
def succ
  succ_hi, succ_lo = self.hi, self.lo + 1
  if succ_lo > 0x7E
    succ_lo = 0x21
    succ_hi += 1
  end
  return self.class.new(succ_hi << 8 | succ_lo)
end
to_int()
# File tool/jisx0208.rb, line 35
def to_int
  return @code
end
to_sjis()
# File tool/jisx0208.rb, line 64
def to_sjis
  h, l = self.hi, self.lo
  h = (h + 1) / 2 + ((0x21..0x5E).include?(h) ? 0x70 : 0xB0)
  l += self.hi.odd? ? 0x1F + ((l >= 0x60) ? 1 : 0) : 0x7E
  return h << 8 | l
end