2019-06-21 00:45:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class AwardEmojiPresenter < Gitlab::View::Presenter::Delegated
|
2021-09-21 05:12:21 -04:00
|
|
|
presents ::AwardEmoji, as: :award_emoji
|
2019-06-21 00:45:27 -04:00
|
|
|
|
|
|
|
def description
|
2021-10-19 17:12:08 -04:00
|
|
|
as_emoji&.description
|
2019-06-21 00:45:27 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def unicode
|
2021-10-19 17:12:08 -04:00
|
|
|
as_emoji&.hex
|
2019-06-21 00:45:27 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def emoji
|
2021-10-19 17:12:08 -04:00
|
|
|
as_emoji&.codepoints
|
2019-06-21 00:45:27 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def unicode_version
|
2021-10-19 17:12:08 -04:00
|
|
|
as_emoji&.unicode_version
|
2019-06-21 00:45:27 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def as_emoji
|
2021-10-19 17:12:08 -04:00
|
|
|
@emoji ||= TanukiEmoji.find_by_alpha_code(award_emoji.name)
|
2019-06-21 00:45:27 -04:00
|
|
|
end
|
|
|
|
end
|