Class: LabClient::ProjectSnippet

Inherits:
Klass show all
Includes:
ClassHelpers
Defined in:
lib/labclient/projects/snippets/project_snippet.rb

Overview

Inspect Helper

Instance Attribute Summary

Attributes inherited from Klass

#client

Attributes inherited from LabStruct

#response, #table

Instance Method Summary collapse

Methods included from ClassHelpers

#has?, #keys

Methods inherited from Klass

#api_methods, #collect_project_id, #collect_release_id, #collect_repository_id, date_time_attrs, #format_time?, #group_name, #help, #initialize, #klass, #quiet?, #success?, #to_json, #update_self, user_attrs, #valid_group_project_levels, #verbose

Methods included from Docs

#demo, #desc, #doc, docs, #example, #group_name, #help, json, #markdown, #navigation, #option, #result, #subtitle, #title

Methods included from CurlHelper

#curl

Methods included from Logger

#logger, logger, logger_setup

Methods inherited from LabStruct

#[], #[]=, #as_json, #client, #initialize, #key?, #keys, #method_missing, #respond_to_missing?, #slice, #success?, #to_h

Constructor Details

This class inherits a constructor from LabClient::Klass

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class LabClient::LabStruct

Instance Method Details

#agent_detailObject



28
29
30
31
# File 'lib/labclient/projects/snippets/project_snippet.rb', line 28

def agent_detail
  project_id = collect_project_id
  client.projects.snippets.agent_detail(project_id, id)
end

#deleteObject



33
34
35
36
# File 'lib/labclient/projects/snippets/project_snippet.rb', line 33

def delete
  project_id = collect_project_id
  client.projects.snippets.delete(project_id, id)
end

#inspectObject



7
8
9
# File 'lib/labclient/projects/snippets/project_snippet.rb', line 7

def inspect
  "#<ProjectSnippet id: #{id}, title: #{title}>"
end

#note_create(query) ⇒ Object



42
43
44
# File 'lib/labclient/projects/snippets/project_snippet.rb', line 42

def note_create(query)
  client.notes.snippets.create(project_id, id, query)
end

#notesObject



38
39
40
# File 'lib/labclient/projects/snippets/project_snippet.rb', line 38

def notes
  client.notes.snippets.list(project_id, id)
end

#projectObject



11
12
13
14
# File 'lib/labclient/projects/snippets/project_snippet.rb', line 11

def project
  project_id = collect_project_id
  client.projects.show project_id
end

#rawObject Also known as: content



21
22
23
24
# File 'lib/labclient/projects/snippets/project_snippet.rb', line 21

def raw
  project_id = collect_project_id
  client.projects.snippets.raw(project_id, id)
end

#update(query = {}) ⇒ Object



16
17
18
19
# File 'lib/labclient/projects/snippets/project_snippet.rb', line 16

def update(query = {})
  project_id = collect_project_id
  update_self client.projects.snippets.update(project_id, id, query)
end