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