Module: SlackValidBlockKit::Builder::Surfaces
- Included in:
- Runner
- Defined in:
- lib/slack_valid_block_kit/builder/surfaces.rb
Instance Method Summary collapse
- #blocks(blocks:) ⇒ Object
- #home(blocks:, private_metadata: nil, callback_id: nil, external_id: nil) ⇒ Object
- #modal(title:, blocks:, close: nil, submit: nil, private_metadata: nil, callback_id: nil, clear_on_close: nil, notify_on_close: nil, external_id: nil, submit_disabled: nil) ⇒ Object
Instance Method Details
#blocks(blocks:) ⇒ Object
28 29 30 31 32 |
# File 'lib/slack_valid_block_kit/builder/surfaces.rb', line 28 def blocks(blocks:) hash = {} hash[:blocks] = blocks hash end |
#home(blocks:, private_metadata: nil, callback_id: nil, external_id: nil) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/slack_valid_block_kit/builder/surfaces.rb', line 19 def home(blocks:, private_metadata: nil, callback_id: nil, external_id: nil) hash = { type: 'home' } hash[:blocks] = blocks hash[:private_metadata] = unless .nil? hash[:callback_id] = callback_id unless callback_id.nil? hash[:external_id] = external_id unless external_id.nil? hash end |
#modal(title:, blocks:, close: nil, submit: nil, private_metadata: nil, callback_id: nil, clear_on_close: nil, notify_on_close: nil, external_id: nil, submit_disabled: nil) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/slack_valid_block_kit/builder/surfaces.rb', line 4 def modal(title:, blocks:, close: nil, submit: nil, private_metadata: nil, callback_id: nil, clear_on_close: nil, notify_on_close: nil, external_id: nil, submit_disabled: nil) hash = { type: 'modal' } hash[:title] = title hash[:blocks] = blocks hash[:close] = close unless close.nil? hash[:submit] = submit unless submit.nil? hash[:private_metadata] = unless .nil? hash[:callback_id] = callback_id unless callback_id.nil? hash[:clear_on_close] = clear_on_close unless clear_on_close.nil? hash[:notify_on_close] = notify_on_close unless notify_on_close.nil? hash[:external_id] = external_id unless external_id.nil? hash[:submit_disabled] = submit_disabled unless submit_disabled.nil? hash end |