Class: Slack::BlockKit::Composition::PlainText
- Inherits:
-
Object
- Object
- Slack::BlockKit::Composition::PlainText
- Defined in:
- lib/slack/block_kit/composition/plain_text.rb
Overview
An object containing some text, formatted using plain text.
Constant Summary collapse
- TYPE =
'plain_text'
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(text:, emoji: nil) ⇒ PlainText
constructor
A new instance of PlainText.
Constructor Details
#initialize(text:, emoji: nil) ⇒ PlainText
Returns a new instance of PlainText.
12 13 14 15 |
# File 'lib/slack/block_kit/composition/plain_text.rb', line 12 def initialize(text:, emoji: nil) @text = text @emoji = emoji end |
Instance Method Details
#as_json ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/slack/block_kit/composition/plain_text.rb', line 17 def as_json(*) { type: TYPE, text: @text, emoji: @emoji }.compact end |