<aside> 👉
Links (Block base class)
Notion Ruby Mapping Public API Reference
</aside>
String). The default value is "default".self.new creates a TableOfContentsBlock. The block cannot have child blocks.
block = TableOfContentsBlock.new "green_background"
block.block_json
# => {"type"=>"table_of_contents", "object"=>"block", "table_of_contents"=>{"color"=>"green_background"}}
color returns the current color of the TableOfContentsBlock.
block = TableOfContentsBlock.new "green_background"
block.color
# => "green_background"
String).color= changes the color and marks color for the next block update. NotionRubyMapping does not validate the value; specify a color supported by the Notion API.
block = TableOfContentsBlock.new "green_background"
block.color = "orange_background"
block.update_block_json
# => {"table_of_contents"=>{"color"=>"orange_background"}}
$\fbox{implemented in Block}$
true, returns a verification script without sending the update request.save sends the pending color change to the Notion API. Without dry_run, it returns the updated TableOfContentsBlock created from the API response.
block = Block.find "b3c6fe0a5885498aa5cb4c4b3080f4cf"
block.color = "orange_background"
block.save
# => #<NotionRubyMapping::TableOfContentsBlock:...>
Use dry_run: true to inspect the update request without sending it.
block.color = "orange_background"
block.save dry_run: true
# => "#!/bin/sh\n# curl -X PATCH ..."