Class: RageFlip::TextSubstitution
- Inherits:
-
Object
- Object
- RageFlip::TextSubstitution
- Defined in:
- lib/rage_flip/text_substitution.rb
Constant Summary collapse
- SUBSTITUTIONS =
{ "bugeyes" => "(⊙_◎)", "cmd-" => "⌘-", "cmd" => "⌘", "cntl" => "⌃", "disapproval" => "ಠ_ಠ", "dogshrug" => '¯\_🐶_/¯', "duck-flip" => "(╯°□°)╯︵ ┻(duckflip)┻", "facepalm" => "(-‸ლ)", "flip" => "(╯°□°)╯︵ ┻━┻", "fu" => "t(-__-t)", "heresatable" => "┬─┬ ノ( ゜-゜ノ)", "javaflip" => "(╯°□°)╯︵ ┻ɐʌɐɾ┻", "kungfuhamster" => ' ()__() / o o\ ; |\'=Y=\';-/ { \ / } mmm mmm ', "noevil" => "🙈🙉🙊", "omw" => "On my way!", "optn" => "⌥", "rage" => "ಠ益ಠ", "rageflip" => "(ノಠ益ಠ)ノ彡┻━┻", "rock" => '\m/ (>_<) \m/', "shft" => "⇧", "shift" => "⇧", "shrug" => '¯\_(ツ)_/¯', "shrugtable" => '┻━┻ ︵ ¯\(ツ)/¯ ︵ ┻━┻', "unsee" => "♨_♨", "yuno" => "ლ(ಠ益ಠლ)" }.freeze
Class Method Summary collapse
- .list_substitutions ⇒ Object
- .process(substitution_name) ⇒ Object
- .substitution_exists?(name) ⇒ Boolean
- .substitution_names ⇒ Object
Class Method Details
.list_substitutions ⇒ Object
43 44 45 46 47 48 49 50 51 |
# File 'lib/rage_flip/text_substitution.rb', line 43 def self.list_substitutions output = ["Available text substitutions:"] SUBSTITUTIONS.each do |name, text| # Truncate long substitutions for display display_text = (text.length > 50) ? "#{text[0..47]}..." : text output << " #{name.ljust(15)} - #{display_text}" end output.join("\n") end |
.process(substitution_name) ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/rage_flip/text_substitution.rb', line 35 def self.process(substitution_name) substitution_name = substitution_name.downcase if SUBSTITUTIONS.key?(substitution_name) SUBSTITUTIONS[substitution_name] end end |
.substitution_exists?(name) ⇒ Boolean
53 54 55 |
# File 'lib/rage_flip/text_substitution.rb', line 53 def self.substitution_exists?(name) SUBSTITUTIONS.key?(name.downcase) end |
.substitution_names ⇒ Object
57 58 59 |
# File 'lib/rage_flip/text_substitution.rb', line 57 def self.substitution_names SUBSTITUTIONS.keys end |