Class: Slackened::BlockKit::Blocks::Header
- Defined in:
- lib/slackened/block_kit/blocks/header.rb
Constant Summary collapse
- MAX_LENGTH =
150
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(plain_text) ⇒ Header
constructor
A new instance of Header.
Methods inherited from Base
Constructor Details
#initialize(plain_text) ⇒ Header
Returns a new instance of Header.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/slackened/block_kit/blocks/header.rb', line 12 def initialize(plain_text) raise MaximumCharactersError, "#{plain_text} can't be greater than #{MAX_LENGTH}" if plain_text.length > MAX_LENGTH raise MustBeString unless plain_text.is_a? String set({ type: :header, text: { type: :plain_text, # cannot be :mrkdwn text: plain_text } }) self end |