Class: EmojiData
| Defined in: | src/emoji_data.coffee |
Class Method Summary
-
.
(Array<EmojiChar>)
all()
Returns a list of all known Emoji characters as
EmojiCharobjects. -
.
(Array<EmojiChar>)
all_doublebyte()
Returns a list of all
EmojiCharthat are represented with doublebyte encoding. -
.
(Array<EmojiChar>)
all_with_variants()
Returns a list of all
EmojiCharthat have at least one variant encoding. - . (Array<String>) chars(options = { include_variants: false }) Returns a list of all known Emoji characters rendered as UCS-2 strings.
- . (Array<String>) codepoints(options = { include_variants: false }) Returns a list of all known codepoints representing Emoji characters.
- . (String) char_to_unified(char) Convert a native UCS-2 string glyph to its unified codepoint ID.
- . (String) unified_to_char(uid) Convert a unified codepoint ID directly to its UCS-2 string representation.
-
.
(Array<EmojiChar>)
find_by_name(name)
Finds any
EmojiCharthat contains given string in its official name. -
.
(Array<EmojiChar>)
find_by_short_name(name)
Find all
EmojiCharthat match string in any of their associated short name keywords. -
.
(EmojiChar)
from_short_name(name)
Finds a specific
EmojiCharbased on the unified codepoint ID. -
.
(EmojiChar)
from_unified(uid)
Finds a specific
EmojiCharbased on its unified codepoint ID. - . (Array<EmojiChar>) scan(str) Scans a string for all encoded emoji characters contained within.
Class Method Details
.
(Array<EmojiChar>)
all()
Returns a list of all known Emoji characters as EmojiChar objects.
.
(Array<EmojiChar>)
all_doublebyte()
Returns a list of all EmojiChar that are represented with doublebyte
encoding.
.
(Array<EmojiChar>)
all_with_variants()
Returns a list of all EmojiChar that have at least one variant encoding.
.
(Array<String>)
chars(options = {
include_variants: false
})
Returns a list of all known Emoji characters rendered as UCS-2 strings.
By default, the default rendering options for this library will be used.
However, if you pass an option hash with include_variants: true then all
possible renderings of a single glyph will be included, meaning that:
- You will have "duplicate" emojis in your list.
- This list is now suitable for exhaustably matching against in a search.
.
(Array<String>)
codepoints(options = {
include_variants: false
})
Returns a list of all known codepoints representing Emoji characters.
.
(String)
char_to_unified(char)
Convert a native UCS-2 string glyph to its unified codepoint ID.
This is a conversion operation, not a match, so it may produce unexpected results with different types of values.
Examples:
> EmojiData.unified_to_char("1F47E");
'👾'
.
(String)
unified_to_char(uid)
Convert a unified codepoint ID directly to its UCS-2 string representation.
Examples:
> EmojiData.char_to_unified("👾");
'1F47E'
.
(Array<EmojiChar>)
find_by_name(name)
Finds any EmojiChar that contains given string in its official name.
.
(Array<EmojiChar>)
find_by_short_name(name)
Find all EmojiChar that match string in any of their associated short
name keywords.
.
(EmojiChar)
from_short_name(name)
Finds a specific EmojiChar based on the unified codepoint ID.
Must be exact match.
.
(EmojiChar)
from_unified(uid)
Finds a specific EmojiChar based on its unified codepoint ID.
.
(Array<EmojiChar>)
scan(str)
Scans a string for all encoded emoji characters contained within.
string, in the order they appeared.