Module: TanukiEmoji
- Defined in:
- lib/tanuki_emoji.rb,
lib/tanuki_emoji/db.rb,
lib/tanuki_emoji/index.rb,
lib/tanuki_emoji/errors.rb,
lib/tanuki_emoji/version.rb,
lib/tanuki_emoji/character.rb,
lib/tanuki_emoji/db/gemojione.rb,
lib/tanuki_emoji/db/emoji_data.rb,
lib/tanuki_emoji/db/unicode_ordering.rb,
lib/tanuki_emoji/db/emoji_data_parser.rb,
lib/tanuki_emoji/db/emoji_test_parser.rb,
lib/tanuki_emoji/db/additional_aliases.rb
Overview
Tanuki Emoji
Defined Under Namespace
Modules: Db Classes: AlphaCodeAlreadyIndexedError, Character, CodepointAlreadyIndexedError, Index
Constant Summary collapse
- Error =
Class.new(StandardError)
- VERSION =
'0.13.0'
Class Method Summary collapse
-
.add(name, codepoints:, alpha_code:, description:, category:) ⇒ TanukiEmoji::Character
Add a new Emoji to the index.
-
.find_by_alpha_code(alpha_code) ⇒ TanukiEmoji::Character
Find an Emoji by its :alpha_code:.
-
.find_by_codepoints(unicode_codepoints) ⇒ TanukiEmoji::Character
Find an Emoji by its Unicode representation.
- .images_path ⇒ Object
-
.index ⇒ Array<TanukiEmoji::Character>
Index contains all known emojis.
Class Method Details
.add(name, codepoints:, alpha_code:, description:, category:) ⇒ TanukiEmoji::Character
Add a new Emoji to the index
44 45 46 47 48 49 50 51 52 |
# File 'lib/tanuki_emoji.rb', line 44 def self.add(name, codepoints:, alpha_code:, description:, category:) emoji = Character.new(name, codepoints: codepoints, alpha_code: alpha_code, description: description, category: category) index.add(emoji) end |
.find_by_alpha_code(alpha_code) ⇒ TanukiEmoji::Character
Find an Emoji by its :alpha_code:
17 18 19 |
# File 'lib/tanuki_emoji.rb', line 17 def self.find_by_alpha_code(alpha_code) index.find_by_alpha_code(alpha_code) end |
.find_by_codepoints(unicode_codepoints) ⇒ TanukiEmoji::Character
Find an Emoji by its Unicode representation
25 26 27 |
# File 'lib/tanuki_emoji.rb', line 25 def self.find_by_codepoints(unicode_codepoints) index.find_by_codepoints(unicode_codepoints) end |
.images_path ⇒ Object
54 55 56 |
# File 'lib/tanuki_emoji.rb', line 54 def self.images_path File.(File.join(__dir__, "../app/assets/images/tanuki_emoji")) end |
.index ⇒ Array<TanukiEmoji::Character>
Index contains all known emojis
32 33 34 |
# File 'lib/tanuki_emoji.rb', line 32 def self.index TanukiEmoji::Index.instance end |