Method: Gitlab::Client::Snippets#snippet_content

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

#snippet_content(project, id) ⇒ Gitlab::ObjectifiedHash

Returns raw project snippet content as plain text.

Examples:

Gitlab.snippet_content(2, 14)

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • id (Integer)

    The ID of a snippet.

Returns:


88
89
90
91
92
93
# File 'lib/gitlab/client/snippets.rb', line 88

def snippet_content(project, id)
  get("/projects/#{url_encode project}/snippets/#{id}/raw",
      format: nil,
      headers: { Accept: 'text/plain' },
      parser: ::Gitlab::Request::Parser)
end