class Slack::BlockKit::Element::DatePicker
An element which lets users easily select a date from a calendar style UI.
Date picker elements can be used inside of section and actions blocks.
Constants
- TYPE
Public Class Methods
new(action_id:, placeholder: nil, initial: nil, emoji: nil) { |self| ... }
click to toggle source
# File lib/slack/block_kit/element/date_picker.rb, line 15 def initialize(action_id:, placeholder: nil, initial: nil, emoji: nil) @action_id = action_id @initial_date = initial if placeholder @placeholder = Composition::PlainText.new( text: placeholder, emoji: emoji ) end yield(self) if block_given? end
Public Instance Methods
as_json(*)
click to toggle source
# File lib/slack/block_kit/element/date_picker.rb, line 36 def as_json(*) { type: TYPE, action_id: @action_id, placeholder: @placeholder&.as_json, initial_date: @initial_date, confirm: @confirm&.as_json }.compact end
confirmation_dialog() { |confirm| ... }
click to toggle source
# File lib/slack/block_kit/element/date_picker.rb, line 28 def confirmation_dialog @confirm = Composition::ConfirmationDialog.new yield(@confirm) if block_given? self end