Class: LabClient::PushRules

Inherits:
Common
  • Object
show all
Includes:
ClassHelpers
Defined in:
lib/labclient/projects/push_rules/show.rb,
lib/labclient/projects/push_rules/client.rb,
lib/labclient/projects/push_rules/create.rb,
lib/labclient/projects/push_rules/delete.rb,
lib/labclient/projects/push_rules/update.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 included from ClassHelpers

#has?, #keys, #raw

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

#create(project_id, query) ⇒ Object



38
39
40
41
42
# File 'lib/labclient/projects/push_rules/create.rb', line 38

def create(project_id, query)
  project_id = format_id(project_id)

  client.request(:post, "projects/#{project_id}/push_rule", PushRule, query)
end

#delete(project_id) ⇒ Object



26
27
28
29
30
# File 'lib/labclient/projects/push_rules/delete.rb', line 26

def delete(project_id)
  project_id = format_id(project_id)

  client.request(:delete, "projects/#{project_id}/push_rule")
end

#show(project_id) ⇒ Object



25
26
27
28
29
# File 'lib/labclient/projects/push_rules/show.rb', line 25

def show(project_id)
  project_id = format_id(project_id)

  client.request(:get, "projects/#{project_id}/push_rule", PushRule)
end

#update(project_id, query) ⇒ Object



45
46
47
48
49
# File 'lib/labclient/projects/push_rules/update.rb', line 45

def update(project_id, query)
  project_id = format_id(project_id)

  client.request(:put, "projects/#{project_id}/push_rule", PushRule, query)
end