Class: SemaphoreClient
- Inherits:
-
Object
- Object
- SemaphoreClient
- Defined in:
- lib/semaphore_client.rb,
lib/semaphore_client/api/org.rb,
lib/semaphore_client/version.rb,
lib/semaphore_client/api/team.rb,
lib/semaphore_client/api/user.rb,
lib/semaphore_client/model/org.rb,
lib/semaphore_client/exceptions.rb,
lib/semaphore_client/model/team.rb,
lib/semaphore_client/model/user.rb,
lib/semaphore_client/api/env_var.rb,
lib/semaphore_client/api/project.rb,
lib/semaphore_client/http_client.rb,
lib/semaphore_client/model/env_var.rb,
lib/semaphore_client/model/project.rb,
lib/semaphore_client/api/config_file.rb,
lib/semaphore_client/api/shared_config.rb,
lib/semaphore_client/model/config_file.rb,
lib/semaphore_client/model/shared_config.rb
Defined Under Namespace
Modules: Api, Model Classes: Exceptions, HttpClient
Constant Summary collapse
- API_URL =
"https://api.semaphoreci.com"- API_VERSION =
"v2"- VERSION =
"2.1.2"
Instance Method Summary collapse
- #config_files ⇒ Object
- #env_vars ⇒ Object
-
#initialize(auth_token, options = {}) ⇒ SemaphoreClient
constructor
A new instance of SemaphoreClient.
- #orgs ⇒ Object
- #projects ⇒ Object
- #shared_configs ⇒ Object
- #teams ⇒ Object
- #users ⇒ Object
Constructor Details
#initialize(auth_token, options = {}) ⇒ SemaphoreClient
Returns a new instance of SemaphoreClient.
28 29 30 31 32 33 34 35 |
# File 'lib/semaphore_client.rb', line 28 def initialize(auth_token, = {}) @auth_token = auth_token @api_url = .fetch(:api_url, API_URL) @api_version = .fetch(:api_version, API_VERSION) @verbose = .fetch(:verbose, false) @logger = .fetch(:logger, Logger.new(STDOUT)) end |
Instance Method Details
#config_files ⇒ Object
61 62 63 |
# File 'lib/semaphore_client.rb', line 61 def config_files @config_file_api ||= SemaphoreClient::Api::ConfigFile.new(http_client) end |
#env_vars ⇒ Object
57 58 59 |
# File 'lib/semaphore_client.rb', line 57 def env_vars @env_var_api ||= SemaphoreClient::Api::EnvVar.new(http_client) end |
#orgs ⇒ Object
41 42 43 |
# File 'lib/semaphore_client.rb', line 41 def orgs @org_api ||= SemaphoreClient::Api::Org.new(http_client) end |
#projects ⇒ Object
49 50 51 |
# File 'lib/semaphore_client.rb', line 49 def projects @project_api ||= SemaphoreClient::Api::Project.new(http_client) end |
#shared_configs ⇒ Object
53 54 55 |
# File 'lib/semaphore_client.rb', line 53 def shared_configs @shared_config_api ||= SemaphoreClient::Api::SharedConfig.new(http_client) end |
#teams ⇒ Object
45 46 47 |
# File 'lib/semaphore_client.rb', line 45 def teams @team_api ||= SemaphoreClient::Api::Team.new(http_client) end |
#users ⇒ Object
37 38 39 |
# File 'lib/semaphore_client.rb', line 37 def users @user_api ||= SemaphoreClient::Api::User.new(http_client) end |