Class: Emojidex::Data::Emoji
- Inherits:
-
Object
- Object
- Emojidex::Data::Emoji
- Includes:
- EmojiAssetInformation
- Defined in:
- lib/emojidex/data/emoji.rb
Overview
emoji base class
Instance Attribute Summary collapse
-
#base ⇒ Object
Returns the value of attribute base.
-
#category ⇒ Object
Returns the value of attribute category.
-
#code ⇒ Object
Returns the value of attribute code.
-
#code_ja ⇒ Object
Returns the value of attribute code_ja.
-
#emoticon ⇒ Object
Returns the value of attribute emoticon.
-
#moji ⇒ Object
Returns the value of attribute moji.
-
#r18 ⇒ Object
Returns the value of attribute r18.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#unicode ⇒ Object
Returns the value of attribute unicode.
-
#variants ⇒ Object
Returns the value of attribute variants.
Attributes included from EmojiAssetInformation
#checksums, #paths, #remote_checksums
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?
Constructor Details
#initialize(details = {}) ⇒ Emoji
Returns a new instance of Emoji.
14 15 16 17 18 |
# File 'lib/emojidex/data/emoji.rb', line 14 def initialize(details = {}) _init_identifier_info(details) _init_descriptor_info(details) init_asset_info(details) end |
Instance Attribute Details
#base ⇒ Object
Returns the value of attribute base.
8 9 10 |
# File 'lib/emojidex/data/emoji.rb', line 8 def base @base end |
#category ⇒ Object
Returns the value of attribute category.
8 9 10 |
# File 'lib/emojidex/data/emoji.rb', line 8 def category @category end |
#code ⇒ Object
Returns the value of attribute code.
8 9 10 |
# File 'lib/emojidex/data/emoji.rb', line 8 def code @code end |
#code_ja ⇒ Object
Returns the value of attribute code_ja.
8 9 10 |
# File 'lib/emojidex/data/emoji.rb', line 8 def code_ja @code_ja end |
#emoticon ⇒ Object
Returns the value of attribute emoticon.
8 9 10 |
# File 'lib/emojidex/data/emoji.rb', line 8 def emoticon @emoticon end |
#moji ⇒ Object
Returns the value of attribute moji.
8 9 10 |
# File 'lib/emojidex/data/emoji.rb', line 8 def moji @moji end |
#r18 ⇒ Object
Returns the value of attribute r18.
8 9 10 |
# File 'lib/emojidex/data/emoji.rb', line 8 def r18 @r18 end |
#tags ⇒ Object
Returns the value of attribute tags.
8 9 10 |
# File 'lib/emojidex/data/emoji.rb', line 8 def @tags end |
#unicode ⇒ Object
Returns the value of attribute unicode.
8 9 10 |
# File 'lib/emojidex/data/emoji.rb', line 8 def unicode @unicode end |
#variants ⇒ Object
Returns the value of attribute variants.
8 9 10 |
# File 'lib/emojidex/data/emoji.rb', line 8 def variants @variants end |
Instance Method Details
#[](key) ⇒ Object
36 37 38 |
# File 'lib/emojidex/data/emoji.rb', line 36 def [](key) instance_variable_get(key.to_s.delete(':').insert(0, '@')) end |
#[]=(key, val) ⇒ Object
40 41 42 |
# File 'lib/emojidex/data/emoji.rb', line 40 def []=(key, val) instance_variable_set(key.to_s.delete(':').insert(0, '@'), val) end |
#to_hash ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/emojidex/data/emoji.rb', line 28 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
24 25 26 |
# File 'lib/emojidex/data/emoji.rb', line 24 def to_json(*args) to_hash.to_json(*args) end |
#to_s ⇒ Object
20 21 22 |
# File 'lib/emojidex/data/emoji.rb', line 20 def to_s @moji || Emojidex.encapsulate_code(@code) end |