class Slackert::Blocks::Header

Header block element provides a title, rendered as a larger bold text on top of the message.

Public Class Methods

new(text) click to toggle source

@param text [String] header text

Calls superclass method Slackert::Blocks::BlockElement::new
# File lib/slackert/blocks.rb, line 24
def initialize(text)
  super('header')
  @text = text
end

Public Instance Methods

to_slack() click to toggle source

See {BlockElement#to_slack}

# File lib/slackert/blocks.rb, line 30
def to_slack
  {
    'type': @type,
    'text': {
      'type': 'plain_text',
      'text': @text
    }
  }
end