Class: Kramdown::Utils::Entities::Entity

Inherits:
Object
  • Object
show all
Defined in:
lib/monkey_patches/kramdown/utils/entities.rb

Overview

Represents an entity that has a code_point and name.

Instance Method Summary collapse

Instance Method Details

#charObject

Return the UTF8 representation of the entity.



12
13
14
15
16
17
18
# File 'lib/monkey_patches/kramdown/utils/entities.rb', line 12

def char
  if code_point.instance_of?(Array)
    [*code_point].pack('U*') rescue nil
  else
    [code_point].pack('U*') rescue nil
  end
end