Links (Block base class)
PageBookmarkBlockCodeBlockEmbedBlockHeading2BlockLinkToPageBlockQuoteBlockToDoBlockToggleHeading3Block
DatabaseBreadcrumbBlockColumnBlockEquationBlockHeading3BlockNumberedListItemBlockSyncedBlockToggleBlockVideoBlock
1. Class methods
self.new(text_info, checked = false, sub_block: nil, color: “default”) → ToDoBlock
- [PARAM] text_info
- a String like as “text” (String)
- an Array of Strings (Array of Strings)
- a RichTextObject (RichTextObject)
- an Array of RichTextObjects (Array of RichTextObjects)
- a RichTextArray (RichTextArray)
The following objects are used for this argument.
- [PARAM(optional)] checked true if to-do is checked. When checked is not specified, use false.
- [PARAM(optional)] sub_blocks
children blocks (Array of Blocks). In
append block children API
, there is a limit for nesting children as follows. So, children blocks can not have any children.
For blocks that allow children, we allow up to two levels of nesting in a single request.
- [PARAM(optional)] color color string. When a_color is not specified, use “default”
- This block can have children blocks.
self.new
creates a ToDoBlock
object using a text_info
. sub_blocks
, color
and checked
are optional parameters.2. Instance methods
append_block_children(*blocks, dry_run: false) → Array<Block>, String
- [PARAM] blocks array of blocks
- [PARAM(optional)] dry_run: true if you want to create a verification script
append_block_children
method of an existing block appends some block objects. Some blocks allow child blocks to be set up at the same time. However, due to API limitations, grandchild blocks cannot be created at once. There are many types of blocks, so check the page( Append block children sample) to see how to create blocks.append_block_children(blocks, dry_run: true)
creates a shell script using Append block children API for verification. checked → Boolean
checked
returns whether the to_do is checked or not for ToDoBlock
.checked=(new_checked)
- [PARAM] new_checked checked flag (Boolean)
color=
updates the checked flag parameter for ToDoBlock
and sets update_block_key
of the payload object.color → String
color
returns the color string for ToDoBlock
.color=(new_color)
- [PARAM] new_color new color string
color=
updates the color parameter for ToDoBlock
and sets update_block_key
of the payload object.save(dry_run: false)
- [PARAM] dry_run: true if you want to create a verification script
save
updates the Block object with update block API
. The updated object has block information generated from the JSON response.Block.find(id, dry_run: true)
creates a shell script using Retrieve a block API for verification.rich_text_array → RichTextArray
rich_text_array
returns the rich_text parameter of ToDoBlock
.