Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/rahyab/string.rb

Instance Method Summary collapse

Instance Method Details

#to_hObject

Return String in HEX



5
6
7
8
9
# File 'lib/rahyab/string.rb', line 5

def to_h
  codepoints = self.codepoints
  codepoints = codepoints.map {  |n| format('%04x', n) }
  return codepoints.join
end