module SlackAlphabetter
Constants
- VERSION
Public Instance Methods
convert(str, color="white")
click to toggle source
# File lib/slack_alphabetter.rb, line 23 def convert(str, color="white") str.downcase.chars.map { |c| if /[a-zA-Z?@#!]/ =~ c emoji(c, color) elsif c == ' ' " " else " " end }.join end
emoji(char, color='white')
click to toggle source
Your code goes hereā¦
# File lib/slack_alphabetter.rb, line 9 def emoji(char, color='white') case char when '#' char = "hash" when '@' char = "at" when '?' char = "question" when '!' char = "exclamation" end ":alphabet-#{color}-#{char}:" end