Class: Notion::Blocks

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

Instance Method Summary collapse

Methods included from RequestClient

#delete, #get, #patch, #post

Instance Method Details

#childrenObject


5
6
7
# File 'lib/notion-sdk-ruby/resources/blocks.rb', line 5

def children
  Children.new
end

#retrieve(block_id) ⇒ Object


9
10
11
12
# File 'lib/notion-sdk-ruby/resources/blocks.rb', line 9

def retrieve(block_id)
  response = get("/v1/blocks/#{block_id}")
  Block.new(response.body)
end

#update(block_id, body) ⇒ Object


14
15
16
17
# File 'lib/notion-sdk-ruby/resources/blocks.rb', line 14

def update(block_id, body)
  response = patch("/v1/blocks/#{block_id}", body.to_json)
  Block.new(response.body)
end