Class: BlockKit::Layout::RichText
- Defined in:
- lib/block_kit/layout/rich_text.rb
Defined Under Namespace
Modules: Elements Classes: List, Preformatted, Quote, Section
Constant Summary collapse
- SUPPORTED_ELEMENTS =
[ RichText::List, RichText::Preformatted, RichText::Quote, RichText::Section ].freeze
Constants inherited from Base
Instance Method Summary collapse
Methods inherited from Base
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
35 36 37 38 39 |
# File 'lib/block_kit/layout/rich_text.rb', line 35 def append(element) elements << element self end |
#as_json ⇒ Object
41 42 43 |
# File 'lib/block_kit/layout/rich_text.rb', line 41 def as_json(*) super.merge(elements: elements&.map(&:as_json)).compact end |