Class: Slack::BlockKit::Composition::Mrkdwn

Inherits:
Object
  • Object
show all
Defined in:
lib/slack/block_kit/composition/mrkdwn.rb

Overview

An object containing some text, formatted using Slack’s “mrkdwn”.

api.slack.com/reference/messaging/composition-objects#text api.slack.com/messaging/composing/formatting

Constant Summary collapse

TYPE =
'mrkdwn'

Instance Method Summary collapse

Constructor Details

#initialize(text:, verbatim: nil) ⇒ Mrkdwn

Returns a new instance of Mrkdwn.



13
14
15
16
# File 'lib/slack/block_kit/composition/mrkdwn.rb', line 13

def initialize(text:, verbatim: nil)
  @text = text
  @verbatim = verbatim
end

Instance Method Details

#as_jsonObject



18
19
20
21
22
23
24
# File 'lib/slack/block_kit/composition/mrkdwn.rb', line 18

def as_json(*)
  {
    type: TYPE,
    text: @text,
    verbatim: @verbatim
  }.compact
end