Class: Slack::BlockKit::Element::EmailTextInput
- Inherits:
-
Object
- Object
- Slack::BlockKit::Element::EmailTextInput
- Defined in:
- lib/slack/block_kit/element/email_text_input.rb
Overview
A Email input element, similar to the Plain-text input element, creates a single line field where a user can enter an email. It can appear as a single-line field.
Constant Summary collapse
- TYPE =
'email_text_input'
Instance Method Summary collapse
- #as_json ⇒ Object
- #dispatch_action_config(triggers: nil) {|@dispatch_action_config| ... } ⇒ Object
-
#initialize(action_id:, placeholder: nil, initial_value: nil, focus_on_load: nil) ⇒ EmailTextInput
constructor
A new instance of EmailTextInput.
Constructor Details
#initialize(action_id:, placeholder: nil, initial_value: nil, focus_on_load: nil) ⇒ EmailTextInput
Returns a new instance of EmailTextInput.
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/slack/block_kit/element/email_text_input.rb', line 14 def initialize( action_id:, placeholder: nil, initial_value: nil, focus_on_load: nil ) @placeholder = placeholder && Composition::PlainText.new(text: placeholder) @initial_value = initial_value @action_id = action_id @focus_on_load = focus_on_load @dispatch_action_config = nil end |
Instance Method Details
#as_json ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/slack/block_kit/element/email_text_input.rb', line 35 def as_json(*) { type: TYPE, action_id: @action_id, placeholder: @placeholder&.as_json, initial_value: @initial_value, focus_on_load: @focus_on_load, dispatch_action_config: @dispatch_action_config&.as_json }.compact end |
#dispatch_action_config(triggers: nil) {|@dispatch_action_config| ... } ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/slack/block_kit/element/email_text_input.rb', line 27 def dispatch_action_config(triggers: nil) @dispatch_action_config = Composition::DispatchActionConfiguration.new(triggers: triggers) yield(@dispatch_action_config) if block_given? self end |