| Invalid Date
字数 0阅读时长 1 分钟

1. Class methods

self.find(id, dry_run: false) →
🧱
Block
, String

  • [PARAM] id block_id (String)
  • [PARAM] dry_run: true if you want to create a verification script
  • [EXCEPTION] StandardError: throw StandardError when the page is not found.
Block.find(id) creates a Block object with retrieving block API. The created 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.

2. Instance methods

append_block_children(*blocks, position: nil, dry_run: false) → Array<Block>, String

  • [PARAM] blocks array of blocks
  • [PARAM(optional)] position: where to insert (Notion API position)
    • nil (default): append at the end
    • "start": insert at the beginning
    • "end": insert at the end (explicit)
    • "<block_id>": insert after the specified block id (after_block)
  • [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.

destroy →
🧱
Block
, String

destroy sets the block archived flag to true.
destroy dry_run: true creates a shell script using Delete a block API for verification.

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.
 
Loading...
目录