File: string_ext.rb

package info (click to toggle)
ruby-gemojione 4.3.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 31,908 kB
  • sloc: ruby: 908; makefile: 10
file content (18 lines) | stat: -rw-r--r-- 371 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
class String
  def with_emoji_images
    Gemojione.replace_unicode_moji_with_images(self)
  end

  def with_emoji_names
    Gemojione.replace_named_moji_with_images(self)
  end

  def image_url
    Gemojione.image_url_for_name(self.emoji_data['name'])
  end

  def emoji_data
    index = Gemojione.index
    index.find_by_moji(self) || index.find_by_name(self)
  end
end