Module: SlackValidBlockKit::Builder::Compositions
- Included in:
- Runner
- Defined in:
- lib/slack_valid_block_kit/builder/compositions.rb
Instance Method Summary collapse
- #confirmation(title:, text:, confirm:, deny:, style: nil) ⇒ Object
- #dispatch_action_configuration(trigger_actions_on: nil) ⇒ Object
- #filter(include: nil, exclude_external_shared_channels: nil, exclude_bot_users: nil) ⇒ Object
- #mrkdwn(text:, verbatim: nil) ⇒ Object
- #option(text:, value:, description: nil, url: nil) ⇒ Object
- #option_group(label:, options:) ⇒ Object
- #plain_text(text:, emoji: nil) ⇒ Object
Instance Method Details
#confirmation(title:, text:, confirm:, deny:, style: nil) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/slack_valid_block_kit/builder/compositions.rb', line 18 def confirmation(title:, text:, confirm:, deny:, style: nil) hash = {} hash[:title] = title hash[:text] = text hash[:confirm] = confirm hash[:deny] = deny hash[:style] = style unless style.nil? hash end |
#dispatch_action_configuration(trigger_actions_on: nil) ⇒ Object
44 45 46 47 48 |
# File 'lib/slack_valid_block_kit/builder/compositions.rb', line 44 def dispatch_action_configuration(trigger_actions_on: nil) hash = {} hash[:trigger_actions_on] = trigger_actions_on unless trigger_actions_on.nil? hash end |
#filter(include: nil, exclude_external_shared_channels: nil, exclude_bot_users: nil) ⇒ Object
50 51 52 53 54 55 56 |
# File 'lib/slack_valid_block_kit/builder/compositions.rb', line 50 def filter(include: nil, exclude_external_shared_channels: nil, exclude_bot_users: nil) hash = {} hash[:include] = include unless include.nil? hash[:exclude_external_shared_channels] = exclude_external_shared_channels unless exclude_external_shared_channels.nil? hash[:exclude_bot_users] = exclude_bot_users unless exclude_bot_users.nil? hash end |
#mrkdwn(text:, verbatim: nil) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/slack_valid_block_kit/builder/compositions.rb', line 11 def mrkdwn(text:, verbatim: nil) hash = { type: 'mrkdwn' } hash[:text] = text hash[:verbatim] = verbatim unless verbatim.nil? hash end |
#option(text:, value:, description: nil, url: nil) ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/slack_valid_block_kit/builder/compositions.rb', line 28 def option(text:, value:, description: nil, url: nil) hash = {} hash[:text] = text hash[:value] = value hash[:description] = description unless description.nil? hash[:url] = url unless url.nil? hash end |
#option_group(label:, options:) ⇒ Object
37 38 39 40 41 42 |
# File 'lib/slack_valid_block_kit/builder/compositions.rb', line 37 def option_group(label:, options:) hash = {} hash[:label] = label hash[:options] = hash end |
#plain_text(text:, emoji: nil) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/slack_valid_block_kit/builder/compositions.rb', line 4 def plain_text(text:, emoji: nil) hash = { type: 'plain_text' } hash[:text] = text hash[:emoji] = emoji unless emoji.nil? hash end |