Class: Slack::BlockKit::Composition::DispatchActionConfiguration
- Inherits:
-
Object
- Object
- Slack::BlockKit::Composition::DispatchActionConfiguration
- Defined in:
- lib/slack/block_kit/composition/dispatch_action_configuration.rb
Overview
Determines when a plain-text input element will return a block_actions interaction payload.
api.slack.com/reference/block-kit/composition-objects#dispatch_action_config api.slack.com/reference/block-kit/block-elements#input
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(triggers: nil) ⇒ DispatchActionConfiguration
constructor
A new instance of DispatchActionConfiguration.
- #trigger_on_character_entered ⇒ Object
- #trigger_on_enter_pressed ⇒ Object
Constructor Details
#initialize(triggers: nil) ⇒ DispatchActionConfiguration
Returns a new instance of DispatchActionConfiguration.
14 15 16 |
# File 'lib/slack/block_kit/composition/dispatch_action_configuration.rb', line 14 def initialize(triggers: nil) @triggers = triggers || [] end |
Instance Method Details
#as_json ⇒ Object
26 27 28 29 30 |
# File 'lib/slack/block_kit/composition/dispatch_action_configuration.rb', line 26 def as_json(*) { trigger_actions_on: @triggers.uniq }.compact end |
#trigger_on_character_entered ⇒ Object
22 23 24 |
# File 'lib/slack/block_kit/composition/dispatch_action_configuration.rb', line 22 def trigger_on_character_entered @triggers << :on_character_entered end |
#trigger_on_enter_pressed ⇒ Object
18 19 20 |
# File 'lib/slack/block_kit/composition/dispatch_action_configuration.rb', line 18 def trigger_on_enter_pressed @triggers << :on_enter_pressed end |