class Slack::BlockKit::Element::Button
An interactive element that inserts a button. The button can be a trigger for anything from opening a simple link to starting a complex workflow.
Constants
- TYPE
Public Class Methods
new(text:, action_id:, style: nil, emoji: nil, url: nil, value: nil) { |self| ... }
click to toggle source
# File lib/slack/block_kit/element/button.rb, line 16 def initialize(text:, action_id:, style: nil, emoji: nil, url: nil, value: nil) @text = Composition::PlainText.new(text: text, emoji: emoji) @action_id = action_id @url = url @style = style @value = value yield(self) if block_given? end
Public Instance Methods
as_json(*)
click to toggle source
# File lib/slack/block_kit/element/button.rb, line 26 def as_json(*) { type: TYPE, text: @text.as_json, action_id: @action_id, url: @url, value: @value, style: @style, confirm: confirm&.as_json }.compact end