debian-mirror-gitlab/app/presenters/award_emoji_presenter.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
430 B
Ruby
Raw Normal View History

2019-09-30 21:07:59 +05:30
# frozen_string_literal: true
class AwardEmojiPresenter < Gitlab::View::Presenter::Delegated
2021-11-18 22:05:49 +05:30
presents ::AwardEmoji, as: :award_emoji
2019-09-30 21:07:59 +05:30
def description
2021-12-11 22:18:48 +05:30
as_emoji&.description
2019-09-30 21:07:59 +05:30
end
def unicode
2021-12-11 22:18:48 +05:30
as_emoji&.hex
2019-09-30 21:07:59 +05:30
end
def emoji
2021-12-11 22:18:48 +05:30
as_emoji&.codepoints
2019-09-30 21:07:59 +05:30
end
def unicode_version
2021-12-11 22:18:48 +05:30
as_emoji&.unicode_version
2019-09-30 21:07:59 +05:30
end
private
def as_emoji
2021-12-11 22:18:48 +05:30
@emoji ||= TanukiEmoji.find_by_alpha_code(award_emoji.name)
2019-09-30 21:07:59 +05:30
end
end