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.
11 12 13 14 |
# File 'lib/prawn/emoji/drawer.rb', line 11 def initialize(document:) @document = document @emoji_index = Emoji::Index.new end |
Instance Method Details
#draw(text, text_options) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/prawn/emoji/drawer.rb', line 16 def draw(text, ) # Skip if text encoding is not UTF-8. return text unless text.encoding == ::Encoding::UTF_8 draw_emoji(text, ) end |