Module: LitaGithub::Octo

Overview

Github handler common-use Octokit methods

Author:

Instance Method Summary collapse

Instance Method Details

#access_tokenString

Accessor method for the Github access token in the config

Returns:

  • (String)

    the Github API access token

Author:



28
29
30
# File 'lib/lita-github/octo.rb', line 28

def access_token
  config.access_token
end

#octoOctokit::Client

Object access method for Octokit client

Examples:

octo.create_team('PagerDuty', name: 'Example Group', perms:pull)

Returns:

  • (Octokit::Client)

Author:



48
49
50
# File 'lib/lita-github/octo.rb', line 48

def octo
  @@octo
end

#setup_octo(_) ⇒ NilClass

To be used to set up Octokit::Client when loading the Handler class

Returns:

  • (NilClass)

Author:



36
37
38
39
40
# File 'lib/lita-github/octo.rb', line 36

def setup_octo(_)
  @@octo ||= Octokit::Client.new(access_token: access_token)
  @@octo.auto_paginate = true
  nil
end