Class: Emojidex::Data::Emoji
- Inherits:
-
Object
- Object
- Emojidex::Data::Emoji
- Defined in:
- lib/emojidex/data/emoji.rb
Overview
emoji base class
Instance Attribute Summary collapse
-
#base ⇒ Object
Attribute Definitions: * moji: the actual character code associated with this emoji (if any) * category: category this emoji belongs to (usually as defined by Unicode) * code: the “short code” for the emoji * code_ja: the Japanese version of the “short code” * unicode: a string representing the hex of the unicode characters with - between multiples * tags: the tags registered to this emoji (usually only from the service) * emoticon: the emoticon that maps to this emoji (rarely used/not recommended) * variants: different (variants) of the emoji EG: racial modifiers * base: the base variant EG: the base emoji without modifiers * r18: flag indicating adult content.
-
#category ⇒ Object
Attribute Definitions: * moji: the actual character code associated with this emoji (if any) * category: category this emoji belongs to (usually as defined by Unicode) * code: the “short code” for the emoji * code_ja: the Japanese version of the “short code” * unicode: a string representing the hex of the unicode characters with - between multiples * tags: the tags registered to this emoji (usually only from the service) * emoticon: the emoticon that maps to this emoji (rarely used/not recommended) * variants: different (variants) of the emoji EG: racial modifiers * base: the base variant EG: the base emoji without modifiers * r18: flag indicating adult content.
-
#code ⇒ Object
Attribute Definitions: * moji: the actual character code associated with this emoji (if any) * category: category this emoji belongs to (usually as defined by Unicode) * code: the “short code” for the emoji * code_ja: the Japanese version of the “short code” * unicode: a string representing the hex of the unicode characters with - between multiples * tags: the tags registered to this emoji (usually only from the service) * emoticon: the emoticon that maps to this emoji (rarely used/not recommended) * variants: different (variants) of the emoji EG: racial modifiers * base: the base variant EG: the base emoji without modifiers * r18: flag indicating adult content.
-
#code_ja ⇒ Object
Attribute Definitions: * moji: the actual character code associated with this emoji (if any) * category: category this emoji belongs to (usually as defined by Unicode) * code: the “short code” for the emoji * code_ja: the Japanese version of the “short code” * unicode: a string representing the hex of the unicode characters with - between multiples * tags: the tags registered to this emoji (usually only from the service) * emoticon: the emoticon that maps to this emoji (rarely used/not recommended) * variants: different (variants) of the emoji EG: racial modifiers * base: the base variant EG: the base emoji without modifiers * r18: flag indicating adult content.
-
#emoticon ⇒ Object
Attribute Definitions: * moji: the actual character code associated with this emoji (if any) * category: category this emoji belongs to (usually as defined by Unicode) * code: the “short code” for the emoji * code_ja: the Japanese version of the “short code” * unicode: a string representing the hex of the unicode characters with - between multiples * tags: the tags registered to this emoji (usually only from the service) * emoticon: the emoticon that maps to this emoji (rarely used/not recommended) * variants: different (variants) of the emoji EG: racial modifiers * base: the base variant EG: the base emoji without modifiers * r18: flag indicating adult content.
-
#moji ⇒ Object
Attribute Definitions: * moji: the actual character code associated with this emoji (if any) * category: category this emoji belongs to (usually as defined by Unicode) * code: the “short code” for the emoji * code_ja: the Japanese version of the “short code” * unicode: a string representing the hex of the unicode characters with - between multiples * tags: the tags registered to this emoji (usually only from the service) * emoticon: the emoticon that maps to this emoji (rarely used/not recommended) * variants: different (variants) of the emoji EG: racial modifiers * base: the base variant EG: the base emoji without modifiers * r18: flag indicating adult content.
-
#r18 ⇒ Object
Attribute Definitions: * moji: the actual character code associated with this emoji (if any) * category: category this emoji belongs to (usually as defined by Unicode) * code: the “short code” for the emoji * code_ja: the Japanese version of the “short code” * unicode: a string representing the hex of the unicode characters with - between multiples * tags: the tags registered to this emoji (usually only from the service) * emoticon: the emoticon that maps to this emoji (rarely used/not recommended) * variants: different (variants) of the emoji EG: racial modifiers * base: the base variant EG: the base emoji without modifiers * r18: flag indicating adult content.
-
#tags ⇒ Object
Attribute Definitions: * moji: the actual character code associated with this emoji (if any) * category: category this emoji belongs to (usually as defined by Unicode) * code: the “short code” for the emoji * code_ja: the Japanese version of the “short code” * unicode: a string representing the hex of the unicode characters with - between multiples * tags: the tags registered to this emoji (usually only from the service) * emoticon: the emoticon that maps to this emoji (rarely used/not recommended) * variants: different (variants) of the emoji EG: racial modifiers * base: the base variant EG: the base emoji without modifiers * r18: flag indicating adult content.
-
#unicode ⇒ Object
Attribute Definitions: * moji: the actual character code associated with this emoji (if any) * category: category this emoji belongs to (usually as defined by Unicode) * code: the “short code” for the emoji * code_ja: the Japanese version of the “short code” * unicode: a string representing the hex of the unicode characters with - between multiples * tags: the tags registered to this emoji (usually only from the service) * emoticon: the emoticon that maps to this emoji (rarely used/not recommended) * variants: different (variants) of the emoji EG: racial modifiers * base: the base variant EG: the base emoji without modifiers * r18: flag indicating adult content.
-
#variants ⇒ Object
Attribute Definitions: * moji: the actual character code associated with this emoji (if any) * category: category this emoji belongs to (usually as defined by Unicode) * code: the “short code” for the emoji * code_ja: the Japanese version of the “short code” * unicode: a string representing the hex of the unicode characters with - between multiples * tags: the tags registered to this emoji (usually only from the service) * emoticon: the emoticon that maps to this emoji (rarely used/not recommended) * variants: different (variants) of the emoji EG: racial modifiers * base: the base variant EG: the base emoji without modifiers * r18: flag indicating adult content.
Attributes included from EmojiAssetInformation
#checksums, #paths, #remote_checksums
Attributes included from EmojiComponentSetInformation
#combinations, #customizations
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, val) ⇒ Object
-
#initialize(details = {}) ⇒ Emoji
constructor
A new instance of Emoji.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
- #to_s ⇒ Object
Methods included from EmojiAssetInformation
#blank_checksums, #blank_paths, #cache, #checksum?, #fill_checksums, #fill_paths, #fill_remote_checksums, #generate_checksum, #generate_checksums, #init_asset_info, #path, #path?
Methods included from EmojiComponentSetInformation
#add_combination, #add_customization, #fill_combinations, #init_combination_info
Constructor Details
#initialize(details = {}) ⇒ Emoji
Returns a new instance of Emoji.
27 28 29 30 31 32 |
# File 'lib/emojidex/data/emoji.rb', line 27 def initialize(details = {}) _init_identifier_info(details) _init_descriptor_info(details) init_combination_info(details) init_asset_info(details) end |
Instance Attribute Details
#base ⇒ Object
Attribute Definitions:
-
moji: the actual character code associated with this emoji (if any)
-
category: category this emoji belongs to (usually as defined by Unicode)
-
code: the “short code” for the emoji
-
code_ja: the Japanese version of the “short code”
-
unicode: a string representing the hex of the unicode characters with - between multiples
-
tags: the tags registered to this emoji (usually only from the service)
-
emoticon: the emoticon that maps to this emoji (rarely used/not recommended)
-
variants: different (variants) of the emoji EG: racial modifiers
-
base: the base variant EG: the base emoji without modifiers
-
r18: flag indicating adult content
20 21 22 |
# File 'lib/emojidex/data/emoji.rb', line 20 def base @base end |
#category ⇒ Object
Attribute Definitions:
-
moji: the actual character code associated with this emoji (if any)
-
category: category this emoji belongs to (usually as defined by Unicode)
-
code: the “short code” for the emoji
-
code_ja: the Japanese version of the “short code”
-
unicode: a string representing the hex of the unicode characters with - between multiples
-
tags: the tags registered to this emoji (usually only from the service)
-
emoticon: the emoticon that maps to this emoji (rarely used/not recommended)
-
variants: different (variants) of the emoji EG: racial modifiers
-
base: the base variant EG: the base emoji without modifiers
-
r18: flag indicating adult content
20 21 22 |
# File 'lib/emojidex/data/emoji.rb', line 20 def category @category end |
#code ⇒ Object
Attribute Definitions:
-
moji: the actual character code associated with this emoji (if any)
-
category: category this emoji belongs to (usually as defined by Unicode)
-
code: the “short code” for the emoji
-
code_ja: the Japanese version of the “short code”
-
unicode: a string representing the hex of the unicode characters with - between multiples
-
tags: the tags registered to this emoji (usually only from the service)
-
emoticon: the emoticon that maps to this emoji (rarely used/not recommended)
-
variants: different (variants) of the emoji EG: racial modifiers
-
base: the base variant EG: the base emoji without modifiers
-
r18: flag indicating adult content
20 21 22 |
# File 'lib/emojidex/data/emoji.rb', line 20 def code @code end |
#code_ja ⇒ Object
Attribute Definitions:
-
moji: the actual character code associated with this emoji (if any)
-
category: category this emoji belongs to (usually as defined by Unicode)
-
code: the “short code” for the emoji
-
code_ja: the Japanese version of the “short code”
-
unicode: a string representing the hex of the unicode characters with - between multiples
-
tags: the tags registered to this emoji (usually only from the service)
-
emoticon: the emoticon that maps to this emoji (rarely used/not recommended)
-
variants: different (variants) of the emoji EG: racial modifiers
-
base: the base variant EG: the base emoji without modifiers
-
r18: flag indicating adult content
20 21 22 |
# File 'lib/emojidex/data/emoji.rb', line 20 def code_ja @code_ja end |
#emoticon ⇒ Object
Attribute Definitions:
-
moji: the actual character code associated with this emoji (if any)
-
category: category this emoji belongs to (usually as defined by Unicode)
-
code: the “short code” for the emoji
-
code_ja: the Japanese version of the “short code”
-
unicode: a string representing the hex of the unicode characters with - between multiples
-
tags: the tags registered to this emoji (usually only from the service)
-
emoticon: the emoticon that maps to this emoji (rarely used/not recommended)
-
variants: different (variants) of the emoji EG: racial modifiers
-
base: the base variant EG: the base emoji without modifiers
-
r18: flag indicating adult content
20 21 22 |
# File 'lib/emojidex/data/emoji.rb', line 20 def emoticon @emoticon end |
#moji ⇒ Object
Attribute Definitions:
-
moji: the actual character code associated with this emoji (if any)
-
category: category this emoji belongs to (usually as defined by Unicode)
-
code: the “short code” for the emoji
-
code_ja: the Japanese version of the “short code”
-
unicode: a string representing the hex of the unicode characters with - between multiples
-
tags: the tags registered to this emoji (usually only from the service)
-
emoticon: the emoticon that maps to this emoji (rarely used/not recommended)
-
variants: different (variants) of the emoji EG: racial modifiers
-
base: the base variant EG: the base emoji without modifiers
-
r18: flag indicating adult content
20 21 22 |
# File 'lib/emojidex/data/emoji.rb', line 20 def moji @moji end |
#r18 ⇒ Object
Attribute Definitions:
-
moji: the actual character code associated with this emoji (if any)
-
category: category this emoji belongs to (usually as defined by Unicode)
-
code: the “short code” for the emoji
-
code_ja: the Japanese version of the “short code”
-
unicode: a string representing the hex of the unicode characters with - between multiples
-
tags: the tags registered to this emoji (usually only from the service)
-
emoticon: the emoticon that maps to this emoji (rarely used/not recommended)
-
variants: different (variants) of the emoji EG: racial modifiers
-
base: the base variant EG: the base emoji without modifiers
-
r18: flag indicating adult content
20 21 22 |
# File 'lib/emojidex/data/emoji.rb', line 20 def r18 @r18 end |
#tags ⇒ Object
Attribute Definitions:
-
moji: the actual character code associated with this emoji (if any)
-
category: category this emoji belongs to (usually as defined by Unicode)
-
code: the “short code” for the emoji
-
code_ja: the Japanese version of the “short code”
-
unicode: a string representing the hex of the unicode characters with - between multiples
-
tags: the tags registered to this emoji (usually only from the service)
-
emoticon: the emoticon that maps to this emoji (rarely used/not recommended)
-
variants: different (variants) of the emoji EG: racial modifiers
-
base: the base variant EG: the base emoji without modifiers
-
r18: flag indicating adult content
20 21 22 |
# File 'lib/emojidex/data/emoji.rb', line 20 def @tags end |
#unicode ⇒ Object
Attribute Definitions:
-
moji: the actual character code associated with this emoji (if any)
-
category: category this emoji belongs to (usually as defined by Unicode)
-
code: the “short code” for the emoji
-
code_ja: the Japanese version of the “short code”
-
unicode: a string representing the hex of the unicode characters with - between multiples
-
tags: the tags registered to this emoji (usually only from the service)
-
emoticon: the emoticon that maps to this emoji (rarely used/not recommended)
-
variants: different (variants) of the emoji EG: racial modifiers
-
base: the base variant EG: the base emoji without modifiers
-
r18: flag indicating adult content
20 21 22 |
# File 'lib/emojidex/data/emoji.rb', line 20 def unicode @unicode end |
#variants ⇒ Object
Attribute Definitions:
-
moji: the actual character code associated with this emoji (if any)
-
category: category this emoji belongs to (usually as defined by Unicode)
-
code: the “short code” for the emoji
-
code_ja: the Japanese version of the “short code”
-
unicode: a string representing the hex of the unicode characters with - between multiples
-
tags: the tags registered to this emoji (usually only from the service)
-
emoticon: the emoticon that maps to this emoji (rarely used/not recommended)
-
variants: different (variants) of the emoji EG: racial modifiers
-
base: the base variant EG: the base emoji without modifiers
-
r18: flag indicating adult content
20 21 22 |
# File 'lib/emojidex/data/emoji.rb', line 20 def variants @variants end |
Instance Method Details
#[](key) ⇒ Object
55 56 57 |
# File 'lib/emojidex/data/emoji.rb', line 55 def [](key) instance_variable_get(key.to_s.delete(':').insert(0, '@')) end |
#[]=(key, val) ⇒ Object
59 60 61 |
# File 'lib/emojidex/data/emoji.rb', line 59 def []=(key, val) instance_variable_set(key.to_s.delete(':').insert(0, '@'), val) end |
#to_hash ⇒ Object
47 48 49 50 51 52 53 |
# File 'lib/emojidex/data/emoji.rb', line 47 def to_hash hash = {} instance_variables.each do |key| hash[key.to_s.delete('@')] = instance_variable_get(key) end hash end |
#to_json(*args) ⇒ Object
38 39 40 41 42 43 44 45 |
# File 'lib/emojidex/data/emoji.rb', line 38 def to_json(*args) hash = to_hash hash.each do |key, val| hash.delete(key) if (val.instance_of?(Array) && val.length == 0) hash.delete(key) if (val.instance_of?(String) && val == "") end hash.to_json(*args) end |
#to_s ⇒ Object
34 35 36 |
# File 'lib/emojidex/data/emoji.rb', line 34 def to_s @moji || Emojidex.encapsulate_code(@code) end |