🧱

ColumnListBlock

1. Singleton methods

self.new(array_of_sub_blocks) →
🧱
ColumnListBlock

  • [PARAM] array_of_sub_blocks
    • [Block1, Block2, ...] ... The first column includes Block1, and the second column includes Block2, ....
    • [[Block1a, Block1b], [Block2a, Block2b], ...] ... The first column includes Block1a and Block1b, and the second column includes Block2a and Block2b, ...
self.new creates a ColumnListBlock object. When creating a column list block via Append block children, the column_list must have at least 2 columns, and those columns must have at least one child each.
b = ColumnListBlock.new [ CalloutBlock.new("Emoji callout", emoji: "✅"), CalloutBlock.new("Url callout", file_url: "https://img.icons8.com/ios-filled/250/000000/mac-os.png"), ]; b.block_json # => {"type"=>"column_list","object"=>"block","column_list"=>{"children"=>[{"type"=>"column","object"=>"block","column"=>{"children"=>[{"type"=>"callout","object"=>"block","callout"=>{"rich_text"=>[{"type"=>"text", "text"=>{"content"=>"Emoji callout", "link"=>nil}, "plain_text"=>"Emoji callout", "href"=>nil}],"color"=>"default","icon"=>{"type"=>"emoji", "emoji"=>"✅"}}}]}},{"type"=>"column","object"=>"block","column"=>{"children"=>[{"type"=>"callout","object"=>"block","callout"=>{"rich_text"=>[{"type"=>"text", "text"=>{"content"=>"Url callout", "link"=>nil}, "plain_text"=>"Url callout", "href"=>nil}],"color"=>"default","icon"=>{"type"=>"external", "external"=>{"url"=>"https://img.icons8.com/ios-filled/250/000000/mac-os.png"}}}}]}}]}}