Class: Prawn::Emoji::Drawer
- Inherits:
-
Object
- Object
- Prawn::Emoji::Drawer
- Defined in:
- lib/prawn/emoji/drawer.rb
Instance Method Summary collapse
- #draw(text, text_options) ⇒ Object
-
#initialize(document:) ⇒ Drawer
constructor
A new instance of Drawer.
Constructor Details
#initialize(document:) ⇒ Drawer
Returns a new instance of Drawer.
8 9 10 11 |
# File 'lib/prawn/emoji/drawer.rb', line 8 def initialize(document:) @document = document @emoji_index = Emoji::Index.new end |
Instance Method Details
#draw(text, text_options) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/prawn/emoji/drawer.rb', line 13 def draw(text, ) # Skip if text encoding is not UTF-8. return text unless text.encoding == ::Encoding::UTF_8 draw_emoji(text, ) end |