Class: Slack::BlockKit::Layout::Header
- Inherits:
-
Object
- Object
- Slack::BlockKit::Layout::Header
- Defined in:
- lib/slack/block_kit/layout/header.rb
Overview
A header is a plain-text block that displays in a larger, bold font. Use it to delineate between different groups of content in your app’s surfaces.
Constant Summary collapse
- TYPE =
'header'
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(text:, block_id: nil, emoji: nil) ⇒ Header
constructor
A new instance of Header.
Constructor Details
#initialize(text:, block_id: nil, emoji: nil) ⇒ Header
Returns a new instance of Header.
14 15 16 17 |
# File 'lib/slack/block_kit/layout/header.rb', line 14 def initialize(text:, block_id: nil, emoji: nil) @text = Composition::PlainText.new(text: text, emoji: emoji) @block_id = block_id end |
Instance Method Details
#as_json ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/slack/block_kit/layout/header.rb', line 19 def as_json(*) { type: TYPE, text: @text.as_json, block_id: @block_id }.compact end |