Class: Asciify::HTMLEntities

Inherits:
Mapping
  • Object
show all
Defined in:
lib/asciify.rb

Instance Method Summary collapse

Methods inherited from Mapping

#from_utf8, #initialize

Constructor Details

This class inherits a constructor from Asciify::Mapping

Instance Method Details

#[](codepoint) ⇒ Object

mapping from Unicode codepoints to numeric HTML entities

Asciify.new(Asciify::HTMLEntities).convert("\303\244") #=> "ä"


60
61
62
# File 'lib/asciify.rb', line 60

def [](codepoint)
  from_utf8 "&##{codepoint};"
end