Class: LabClient::Runner

Inherits:
Klass show all
Includes:
ClassHelpers
Defined in:
lib/labclient/runners/runner.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, #raw

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

#detailsObject



11
12
13
# File 'lib/labclient/runners/runner.rb', line 11

def details
  update_self client.runners.show(id)
end

#inspectObject



7
8
9
# File 'lib/labclient/runners/runner.rb', line 7

def inspect
  "#<Runner id: #{id}, status: #{status}>"
end

#jobs(query = {}) ⇒ Object



19
20
21
# File 'lib/labclient/runners/runner.rb', line 19

def jobs(query = {})
  client.runners.jobs(id, query)
end

#removeObject



15
16
17
# File 'lib/labclient/runners/runner.rb', line 15

def remove
  client.runners.remove(id)
end

#update(query) ⇒ Object



23
24
25
# File 'lib/labclient/runners/runner.rb', line 23

def update(query)
  update_self client.runners.update(id, query)
end

#verifyObject



27
28
29
30
# File 'lib/labclient/runners/runner.rb', line 27

def verify
  details if token.nil? # Not included in List
  client.runners.verify(token)
end