struct Slack::UI::Blocks::Section

Overview

https://api.slack.com/reference/block-kit/blocks#section

Slack Section Blocks have several behavioral differences based on whether the content of the section is a single text block or multiple blocks.

Defined in:

slack/ui/blocks/section.cr

Constant Summary

ASSIGNED_TYPES = [accessory : BlockElement | ::Nil, block_id : String | ::Nil, fields : Array(FieldText) | ::Nil, text : Text | ::Nil, type : String = "section"] of TypeDeclaration

https://api.slack.com/reference/block-kit/blocks#section

Slack Section Blocks have several behavioral differences based on whether the content of the section is a single text block or multiple blocks.

Constructors

Instance Method Summary

Constructor methods inherited from struct Slack::UI::Block

new(pull : JSON::PullParser) new

Constructor Detail

def self.new(pull : JSON::PullParser) #

https://api.slack.com/reference/block-kit/blocks#section

Slack Section Blocks have several behavioral differences based on whether the content of the section is a single text block or multiple blocks.


[View source]
def self.new(accessory : BlockElement | Nil = nil, block_id : String | Nil = nil, fields : Array(FieldText) | Nil = nil, text : Text | Nil = nil, type : String = "section") #

https://api.slack.com/reference/block-kit/blocks#section

Slack Section Blocks have several behavioral differences based on whether the content of the section is a single text block or multiple blocks.


Instance Method Detail

def accessory : BlockElement | Nil #

def accessory=(accessory : BlockElement | Nil) #

def after_initialize #

Defines validations that prevent Sections from being created:

  • Some form of text is required
  • Arrays of text can only have 10 text objects.

[View source]
def block_id : String | Nil #

def block_id=(block_id : String | Nil) #

def fields : Array(FieldText) | Nil #

def fields=(fields : Array(FieldText) | Nil) #

def text : Text | Nil #

def text=(text : Text | Nil) #

def to_json(json : JSON::Builder) #

[View source]
def type : String #

def type=(type : String) #