Method: Gitlab::Client::Snippets#edit_snippet

Defined in:
lib/gitlab/client/snippets.rb

#edit_snippet(project, id, options = {}) ⇒ Gitlab::ObjectifiedHash

Updates a snippet.

Examples:

Gitlab.edit_snippet(42, 34, { file_name: 'README.txt' })

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • id (Integer)

    The ID of a snippet.

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :title (String)

    The title of a snippet.

  • :file_name (String)

    The name of a snippet file.

  • :code (String)

    The content of a snippet.

  • :lifetime (String)

    The expiration date of a snippet.

  • :visibility (String) — default: optional

    The visibility of a snippet

Returns:



64
65
66
# File 'lib/gitlab/client/snippets.rb', line 64

def edit_snippet(project, id, options = {})
  put("/projects/#{url_encode project}/snippets/#{id}", body: options)
end