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

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

Overview

Represents an entity that has a code_point and name.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#code_pointObject

Returns the value of attribute code_point

Returns:

  • (Object)

    the current value of code_point



31
32
33
# File 'lib/kramdown/utils/entities.rb', line 31

def code_point
  @code_point
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



31
32
33
# File 'lib/kramdown/utils/entities.rb', line 31

def name
  @name
end

Instance Method Details

#charObject

Return the UTF8 representation of the entity.



34
35
36
# File 'lib/kramdown/utils/entities.rb', line 34

def char
  [code_point].pack('U*') rescue nil
end