Class: Utils::Github::OctokitClient

Inherits:
Object
  • Object
show all
Defined in:
lib/bas/utils/github/octokit_client.rb

Overview

This module is a Github utility for making requests to the Github API using the octokit module

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ OctokitClient

Returns a new instance of OctokitClient.



13
14
15
# File 'lib/bas/utils/github/octokit_client.rb', line 13

def initialize(params)
  @params = params
end

Instance Method Details

#executeObject

Build the octokit client using a Github app access token



19
20
21
22
23
# File 'lib/bas/utils/github/octokit_client.rb', line 19

def execute
  { client: octokit }
rescue StandardError => e
  { error: e.to_s }
end

#repository_info(repo) ⇒ Object



25
26
27
28
29
# File 'lib/bas/utils/github/octokit_client.rb', line 25

def repository_info(repo)
  octokit.repository(repo)
rescue StandardError => e
  { error: e.to_s }
end