Class: Notion::Api::BlocksMethods
- Inherits:
-
Object
- Object
- Notion::Api::BlocksMethods
- Includes:
- RequestClient
- Defined in:
- lib/notion-sdk-ruby/api/blocks.rb
Instance Method Summary collapse
- #children ⇒ Notion::Api::BlocksChildrenMethods
-
#retrieve(id) ⇒ Notion::Block
Retrieves a Block object using the ID specified.
-
#update(id, body) ⇒ Notion::Block
Updates the content for the specified block_id based on the block type.
Instance Method Details
#children ⇒ Notion::Api::BlocksChildrenMethods
7 8 9 |
# File 'lib/notion-sdk-ruby/api/blocks.rb', line 7 def children BlocksChildrenMethods.new end |
#retrieve(id) ⇒ Notion::Block
Retrieves a Block object using the ID specified. developers.notion.com/reference/retrieve-a-block
15 16 17 18 |
# File 'lib/notion-sdk-ruby/api/blocks.rb', line 15 def retrieve(id) response = get("/v1/blocks/#{id}") Block.new(response.body) end |
#update(id, body) ⇒ Notion::Block
Updates the content for the specified block_id based on the block type. developers.notion.com/reference/update-a-block
25 26 27 28 |
# File 'lib/notion-sdk-ruby/api/blocks.rb', line 25 def update(id, body) response = patch("/v1/blocks/#{id}", body.to_json) Block.new(response.body) end |