Class: Notion::Api::BlocksChildrenMethods

Inherits:
Object
  • Object
show all
Includes:
RequestClient
Defined in:
lib/notion-sdk-ruby/api/blocks.rb

Instance Method Summary collapse

Instance Method Details

#append(id, body) ⇒ Notion::List<Notion::Block>

Creates and appends new children blocks to the parent block_id specified. developers.notion.com/reference/patch-block-children

Parameters:

  • id (String)

    block_id

  • body (Hash)

Returns:



50
51
52
53
# File 'lib/notion-sdk-ruby/api/blocks.rb', line 50

def append(id, body)
  response = patch("/v1/blocks/#{id}/children", body.to_json)
  List.new(response.body)
end

#list(id, query = {}) ⇒ Notion::List<Notion::Block>

Returns a paginated array of child block objects contained in the block using the ID specified. developers.notion.com/reference/get-block-children

Parameters:

  • id (String)

    block_id

  • query (Hash) (defaults to: {})

Returns:



40
41
42
43
# File 'lib/notion-sdk-ruby/api/blocks.rb', line 40

def list(id, query = {})
  response = get("/v1/blocks/#{id}/children", query)
  List.new(response.body)
end