Class: LabClient::Snippets

Inherits:
Common
  • Object
show all
Defined in:
lib/labclient/snippets/list.rb,
lib/labclient/snippets/show.rb,
lib/labclient/snippets/create.rb,
lib/labclient/snippets/delete.rb,
lib/labclient/snippets/public.rb,
lib/labclient/snippets/update.rb,
lib/labclient/snippets/content.rb,
lib/labclient/snippets/agent_detail.rb

Overview

Specifics

Constant Summary

Constants included from AccessLevel

AccessLevel::HUMAN_ACCESS_LEVELS, AccessLevel::MACHINE_ACCESS_LEVELS

Instance Attribute Summary

Attributes inherited from Common

#client

Instance Method Summary collapse

Methods inherited from Common

#api_methods, #api_methods_help, #format_id, #format_query_id, #format_query_ids, #format_time?, #group_name, #help, #initialize, #inspect, #klass, #protected_query_access_level, #query_access_level, #query_format_time

Methods included from Docs

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

Methods included from AccessLevel

#human_access_level, #human_protected_access_level, #machine_access_level, #machine_protected_access_level

Constructor Details

This class inherits a constructor from LabClient::Common

Instance Method Details

#agent_detail(project_id) ⇒ Object

Show Specific



25
26
27
28
29
# File 'lib/labclient/snippets/agent_detail.rb', line 25

def agent_detail(project_id)
  project_id = format_id(project_id)

  client.request(:get, "snippets/#{project_id}/user_agent_detail")
end

#create(query = {}) ⇒ Object

Create



34
35
36
# File 'lib/labclient/snippets/create.rb', line 34

def create(query = {})
  client.request(:post, 'snippets', Snippet, query)
end

#delete(snippet_id = nil) ⇒ Object

Delete



31
32
33
# File 'lib/labclient/snippets/delete.rb', line 31

def delete(snippet_id = nil)
  client.request(:delete, "snippets/#{snippet_id}")
end

#listObject

List



14
15
16
# File 'lib/labclient/snippets/list.rb', line 14

def list
  client.request(:get, 'snippets', Snippet)
end

#public(query = {}) ⇒ Object



22
23
24
# File 'lib/labclient/snippets/public.rb', line 22

def public(query = {})
  client.request(:get, 'snippets/public', Snippet, query)
end

#raw(snippet_id) ⇒ Object

Show Specific



29
30
31
# File 'lib/labclient/snippets/content.rb', line 29

def raw(snippet_id)
  client.request(:get, "snippets/#{snippet_id}/raw")
end

#show(snippet_id = nil) ⇒ Object

Show Specific



14
15
16
# File 'lib/labclient/snippets/show.rb', line 14

def show(snippet_id = nil)
  client.request(:get, "snippets/#{snippet_id}", Snippet)
end

#update(snippet_id = nil, query = {}) ⇒ Object

Update



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

def update(snippet_id = nil, query = {})
  client.request(:put, "snippets/#{snippet_id}", Snippet, query)
end