Module: Gitlab::Client::Snippets
- Included in:
- Gitlab::Client
- Defined in:
- lib/gitlab/client/snippets.rb
Overview
Defines methods related to snippets.
Instance Method Summary collapse
-
#create_snippet(project, options = {}) ⇒ Gitlab::ObjectifiedHash
Creates a new snippet.
-
#delete_snippet(project, id) ⇒ Gitlab::ObjectifiedHash
Deletes a snippet.
-
#edit_snippet(project, id, options = {}) ⇒ Gitlab::ObjectifiedHash
Updates a snippet.
-
#snippet(project, id) ⇒ Gitlab::ObjectifiedHash
Gets information about a snippet.
-
#snippets(project, options = {}) ⇒ Gitlab::ObjectifiedHash
Gets a list of project’s snippets.
Instance Method Details
#create_snippet(project, options = {}) ⇒ Gitlab::ObjectifiedHash
Creates a new snippet.
42 43 44 45 |
# File 'lib/gitlab/client/snippets.rb', line 42 def create_snippet(project, ={}) check_attributes!(, [:title, :file_name, :code]) post("/projects/#{project}/snippets", :body => ) end |
#delete_snippet(project, id) ⇒ Gitlab::ObjectifiedHash
Deletes a snippet.
72 73 74 |
# File 'lib/gitlab/client/snippets.rb', line 72 def delete_snippet(project, id) delete("/projects/#{project}/snippets/#{id}") end |
#edit_snippet(project, id, options = {}) ⇒ Gitlab::ObjectifiedHash
Updates a snippet.
60 61 62 |
# File 'lib/gitlab/client/snippets.rb', line 60 def edit_snippet(project, id, ={}) put("/projects/#{project}/snippets/#{id}", :body => ) end |
#snippet(project, id) ⇒ Gitlab::ObjectifiedHash
Gets information about a snippet.
26 27 28 |
# File 'lib/gitlab/client/snippets.rb', line 26 def snippet(project, id) get("/projects/#{project}/snippets/#{id}") end |
#snippets(project, options = {}) ⇒ Gitlab::ObjectifiedHash
Gets a list of project’s snippets.
14 15 16 |
# File 'lib/gitlab/client/snippets.rb', line 14 def snippets(project, ={}) get("/projects/#{project}/snippets", :query => ) end |