Class: Teems::Formatters::MessageFormatter
- Inherits:
-
Object
- Object
- Teems::Formatters::MessageFormatter
- Defined in:
- lib/teems/formatters/message_formatter.rb
Overview
Formats messages for terminal display
Constant Summary collapse
- REACTION_EMOJI =
{ 'like' => "\u{1F44D}", 'heart' => "\u{2764}\u{FE0F}", 'laugh' => "\u{1F602}", 'surprised' => "\u{1F62E}", 'sad' => "\u{1F622}", 'angry' => "\u{1F620}", 'yes-tone1' => "\u{1F44D}\u{1F3FB}", 'yes-tone2' => "\u{1F44D}\u{1F3FC}", 'support' => "\u{1F91D}", 'heartblue' => "\u{1F499}", 'computer' => "\u{1F4BB}", '1f37f_popcorn' => "\u{1F37F}", '1f440_eyes' => "\u{1F440}", 'thumbsdown' => "\u{1F44E}" }.freeze
Instance Method Summary collapse
- #format(message) ⇒ Object
-
#initialize(output:, cache_store: nil) ⇒ MessageFormatter
constructor
A new instance of MessageFormatter.
Constructor Details
#initialize(output:, cache_store: nil) ⇒ MessageFormatter
Returns a new instance of MessageFormatter.
17 18 19 20 |
# File 'lib/teems/formatters/message_formatter.rb', line 17 def initialize(output:, cache_store: nil) @output = output @cache_store = cache_store end |
Instance Method Details
#format(message) ⇒ Object
22 23 24 25 26 |
# File 'lib/teems/formatters/message_formatter.rb', line 22 def format() content = highlight_mentions(.content, .mentions) [format_header(), " #{content}", (), format_reactions()] .compact.join("\n") end |