Class: BlockKit::Layout::Input
- Inherits:
-
Base
- Object
- Base
- Base
- BlockKit::Layout::Input
show all
- Defined in:
- lib/block_kit/layout/input.rb
Constant Summary
collapse
- MAX_LABEL_LENGTH =
2000
- MAX_HINT_LENGTH =
2000
- SUPPORTED_ELEMENTS =
[
Elements::ChannelsSelect,
Elements::Checkboxes,
Elements::ConversationsSelect,
Elements::DatePicker,
Elements::DatetimePicker,
Elements::EmailTextInput,
Elements::ExternalSelect,
Elements::FileInput,
Elements::MultiChannelsSelect,
Elements::MultiConversationsSelect,
Elements::MultiExternalSelect,
Elements::MultiStaticSelect,
Elements::,
Elements::NumberInput,
Elements::PlainTextInput,
Elements::RadioButtons,
Elements::RichTextInput,
Elements::StaticSelect,
Elements::TimePicker,
Elements::,
Elements::URLTextInput
].freeze
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
Instance Method Details
#as_json ⇒ Object
100
101
102
103
104
105
106
107
108
|
# File 'lib/block_kit/layout/input.rb', line 100
def as_json(*)
super.merge(
label: label&.as_json,
element: element&.as_json,
dispatch_action: dispatch_action,
hint: hint&.as_json,
optional: optional
).compact
end
|
#dispatch_action? ⇒ Boolean
96
97
98
|
# File 'lib/block_kit/layout/input.rb', line 96
def dispatch_action?
!!dispatch_action
end
|
#optional? ⇒ Boolean
88
89
90
|
# File 'lib/block_kit/layout/input.rb', line 88
def optional?
!!optional
end
|
#required? ⇒ Boolean
92
93
94
|
# File 'lib/block_kit/layout/input.rb', line 92
def required?
!optional?
end
|