Class: Banacle::InteractiveMessage::Renderer
- Inherits:
-
Object
- Object
- Banacle::InteractiveMessage::Renderer
- Defined in:
- lib/banacle/interactive_message/renderer.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Class Method Summary collapse
Instance Method Summary collapse
- #actioner_id ⇒ Object
-
#initialize(request, config) ⇒ Renderer
constructor
A new instance of Renderer.
- #original_message_text ⇒ Object
- #render_approved_message(result) ⇒ Object
- #render_cancelled_message ⇒ Object
- #render_rejected_message ⇒ Object
- #render_replacing_message(text) ⇒ Object
Constructor Details
#initialize(request, config) ⇒ Renderer
Returns a new instance of Renderer.
14 15 16 17 |
# File 'lib/banacle/interactive_message/renderer.rb', line 14 def initialize(request, config) @request = request @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
19 20 21 |
# File 'lib/banacle/interactive_message/renderer.rb', line 19 def config @config end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
19 20 21 |
# File 'lib/banacle/interactive_message/renderer.rb', line 19 def request @request end |
Class Method Details
Instance Method Details
#actioner_id ⇒ Object
58 59 60 |
# File 'lib/banacle/interactive_message/renderer.rb', line 58 def actioner_id request.actioner_id end |
#original_message_text ⇒ Object
54 55 56 |
# File 'lib/banacle/interactive_message/renderer.rb', line 54 def request. end |
#render_approved_message(result) ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/banacle/interactive_message/renderer.rb', line 21 def (result) text = text += ":white_check_mark: *<@#{actioner_id}> approved this request*\n" text += "Result:\n" text += "```\n" text += result text += "```" (text) end |
#render_cancelled_message ⇒ Object
39 40 41 42 43 44 |
# File 'lib/banacle/interactive_message/renderer.rb', line 39 def text = text += "\nThe request was cancelled." (text) end |
#render_rejected_message ⇒ Object
32 33 34 35 36 37 |
# File 'lib/banacle/interactive_message/renderer.rb', line 32 def text = text += ":no_entry_sign: *<@#{actioner_id}> rejected this request*" (text) end |