Class: BlockKit::Layout::Actions

Inherits:
Base
  • Object
show all
Defined in:
lib/block_kit/layout/actions.rb

Constant Summary collapse

MAX_ELEMENTS =
25
SUPPORTED_ELEMENTS =
[
  Elements::Button,
  Elements::ChannelsSelect,
  Elements::Checkboxes,
  Elements::ConversationsSelect,
  Elements::DatePicker,
  Elements::DatetimePicker,
  Elements::ExternalSelect,
  Elements::MultiChannelsSelect,
  Elements::MultiConversationsSelect,
  Elements::MultiExternalSelect,
  Elements::MultiStaticSelect,
  Elements::MultiUsersSelect,
  Elements::Overflow,
  Elements::RadioButtons,
  Elements::RichTextInput,
  Elements::StaticSelect,
  Elements::TimePicker,
  Elements::UsersSelect,
  Elements::WorkflowButton
]

Constants inherited from Base

Base::MAX_BLOCK_ID_LENGTH

Instance Method Summary collapse

Methods inherited from Base

inherited, #initialize

Methods inherited from Base

#==, fix, #fix_validation_errors, #fix_validation_errors!, fixes, inherited, #initialize, inspect, #inspect, #pretty_print, #to_json

Constructor Details

This class inherits a constructor from BlockKit::Layout::Base

Instance Method Details

#append(element) ⇒ Object



66
67
68
69
70
# File 'lib/block_kit/layout/actions.rb', line 66

def append(element)
  elements << element

  self
end

#as_jsonObject



72
73
74
# File 'lib/block_kit/layout/actions.rb', line 72

def as_json(*)
  super.merge(elements: elements&.map(&:as_json)).compact
end