require 'yaml'

module Prawn
  module Emoji
    class Image
      STORE = Emoji.root.join 'emoji', 'images'

      attr_reader :unicode

      def initialize(unicode)
        @unicode = unicode
      end

      def path
        STORE.join("#{codepoint}.png").to_s
      end

      def ==(other)
        unicode == other.unicode
      end

      private

      def codepoint
        @codepoint ||= @unicode.codepoints.map { |c| c.to_s(16) }.join('-').downcase
      end
    end
  end
end

require 'yaml'

module Prawn
  module Emoji
    class Image
      STORE = Emoji.root.join 'emoji', 'images'

      attr_reader :unicode

      def initialize(unicode)
        @unicode = unicode
      end

      def path
        STORE.join("#{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

Fix truncation of longer emoji codepoints
Fix truncation of longer emoji codepoints
