Class: Wikiwiki::CLI::Commands::Attachment::Delete

Inherits:
Base
  • Object
show all
Defined in:
lib/wikiwiki/cli/commands/attachment/delete.rb

Overview

Delete attachment from a page

Instance Method Summary collapse

Instance Method Details

#call(page_name:, file_name:, out: $stdout, err: $stderr) ⇒ void

This method returns an undefined value.

Execute the delete command

Parameters:

  • page_name (String)

    name of the page

  • file_name (String)

    name of the attachment file to delete

  • out (IO) (defaults to: $stdout)

    output stream

  • err (IO) (defaults to: $stderr)

    error stream



21
22
23
24
25
26
27
# File 'lib/wikiwiki/cli/commands/attachment/delete.rb', line 21

def call(page_name:, file_name:, out: $stdout, err: $stderr, **)
  wiki = create_wiki(out:, err:, **)

  wiki.delete_attachment(page_name:, attachment_name: file_name)

  say("Attachment '#{file_name}' deleted from page '#{page_name}'", out:, **)
end