Skip to content

Commit

Permalink
refactor: change Emoji to a reusable class that provides API for fron…
Browse files Browse the repository at this point in the history
…tend code
  • Loading branch information
wwrk22 committed Dec 26, 2023
1 parent 9e4a76c commit b701a64
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 22 deletions.
26 changes: 26 additions & 0 deletions lib/emoji.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# frozen_string_literal: true

class Emoji
DICTIONARY = {
'THUMBS_UP' => '👍',
'THUMBS_DOWN' => '👎',
'THINKING' => '🤔',
'HOORAY' => '🎉',
'SHRUG' => '🤷',
'EYES' => '👀'
}.freeze

class << self
def caption_to_emoji(caption)
DICTIONARY[caption]
end

def emoji_captions
DICTIONARY.keys
end

def emojis
DICTIONARY.values
end
end
end
22 changes: 0 additions & 22 deletions lib/emojis.rb

This file was deleted.

0 comments on commit b701a64

Please sign in to comment.