lib/slackert/blocks.rb
# Adds a field text object to the message. Field texts render in two columns on desktop and are added left
# to right. They show as one column on mobile.
# There can only be 10 fields added in total and each text item has a limit of 2000 characters.
# @param message [String] field text message
# @param type [String] can be either mrkdwn or plain_text
# @raise [RuntimeError] if maximum capacity of 10 field objects has been reached
#
Adds a field text object to the message. Field texts render in two columns on desktop and are added left
to right. They show as one column on mobile.
There can only be 10 fields added in total and each text item has a limit of 2000 characters.
Adds a field text object to the message . Field texts render in two columns on desktop and are added left to right . They show as one column on mobile . There can only be 10 fields added in total and each text item has a limit of 2000 characters .
def add_field_text(message, type = 'mrkdwn')
        raise StandardError, 'Maximum field text objects has been reached.' if @fields.length == 10
        raise ArgumentError, 'Maximum number of characters in text exceeded' if message.length > 2000
        @fields.push(
          {
            'type': type,
            'text': message
          }
        )
      end
def add_field_text ( message , type = 'mrkdwn' ) raise StandardError , 'Maximum field text objects has been reached.' if @fields . length == 10 raise ArgumentError , 'Maximum number of characters in text exceeded' if message . length > 2000 @fields . push ( { 'type' : type , 'text' : message } ) end
Adds a field text object to the message.
Adds a field text object to the message .
[RuntimeError] if maximum capacity of 10 field objects has been reached
[ RuntimeError ] if maximum capacity of 10 field objects has been reached
message
field text message
field text message
type
can be either mrkdwn or plain_text
can be either mrkdwn or plain_text