class EmojiDatasource::Emoji

Attributes

data[R]

Public Class Methods

new(data) click to toggle source
# File lib/emoji_datasource/emoji.rb, line 7
def initialize(data)
  @data = data
end

Public Instance Methods

as_json() click to toggle source
# File lib/emoji_datasource/emoji.rb, line 43
def as_json
  @data
end
inspect() click to toggle source
# File lib/emoji_datasource/emoji.rb, line 35
def inspect
  "#{self.class.name}:#{short_name}"
end
method_missing(method_name, *arguments, &block) click to toggle source
Calls superclass method
# File lib/emoji_datasource/emoji.rb, line 21
def method_missing(method_name, *arguments, &block)
  if @data.key?(method_name)
    @data[method_name]
  else
    super
  end
end
respond_to_missing?(method_name, include_private = false) click to toggle source
Calls superclass method
# File lib/emoji_datasource/emoji.rb, line 29
def respond_to_missing?(method_name, include_private = false)
  return true if @data.key?(method_name)

  super
end
skin_variations() click to toggle source
# File lib/emoji_datasource/emoji.rb, line 15
def skin_variations
  return unless @data[:skin_variations]

  @data[:skin_variations].transform_keys(&:to_s)
end
to_char() click to toggle source
# File lib/emoji_datasource/emoji.rb, line 11
def to_char
  EmojiDatasource.unified_to_char(data[:unified])
end
to_json(**args) click to toggle source
# File lib/emoji_datasource/emoji.rb, line 47
def to_json(**args)
  @data.to_json(**args)
end
to_s() click to toggle source
# File lib/emoji_datasource/emoji.rb, line 39
def to_s
  to_char
end