Class: Notion::Api::BlocksChildrenMethods
- Inherits:
-
Object
- Object
- Notion::Api::BlocksChildrenMethods
- Includes:
- RequestClient
- Defined in:
- lib/notion-sdk-ruby/api/blocks.rb
Instance Method Summary collapse
-
#append(id, body) ⇒ Notion::List<Notion::Block>
Creates and appends new children blocks to the parent block_id specified.
-
#list(id, query = {}) ⇒ Notion::List<Notion::Block>
Returns a paginated array of child block objects contained in the block using the ID specified.
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
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
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 |