lib/notion/api/endpoints/blocks.rb in notion-ruby-client-0.1.0.pre.beta1 vs lib/notion/api/endpoints/blocks.rb in notion-ruby-client-1.0.0.pre.beta1

- old
+ new

@@ -31,9 +31,25 @@ throw ArgumentError.new('Required arguments :block_id missing') if options[:block_id].nil? patch("blocks/#{options[:block_id]}", options.except(:block_id)) end # + # Sets a Block object, including page blocks, to archived: true + # using the ID specified. Note: in the Notion UI application, this + # moves the block to the "Trash" where it can still be accessed and + # restored. + # + # To restore the block with the API, use the Update a block or + # Update page respectively. + # + # @option options [id] :block_id + # Block to get children info on. + def delete_block(options = {}) + throw ArgumentError.new('Required arguments :block_id missing') if options[:block_id].nil? + delete("blocks/#{options[:block_id]}") + end + + # # Returns a paginated array of Block objects contained in the # block of the requested path using the ID specified. # # Returns a 404 HTTP response if any of the following are true: # - the ID does not exist