lib/prawn/emoji/image.rb in prawn-emoji-2.0.1 vs lib/prawn/emoji/image.rb in prawn-emoji-2.1.0

- old
+ new

@@ -1,8 +1,9 @@ # frozen_string_literal: true require 'yaml' +require_relative 'unicode' module Prawn module Emoji class Image STORE = Emoji.root.join 'emoji', 'images' @@ -12,20 +13,14 @@ def initialize(unicode) @unicode = unicode end def path - STORE.join("#{codepoint}.png").to_s + STORE.join("#{unicode.codepoint}.png").to_s end def ==(other) unicode == other.unicode - end - - private - - def codepoint - @codepoint ||= @unicode.codepoints.map { |c| '%04x' % c.to_s }.join('-').downcase end end end end