Sha256: 99024922d455b76e9724df02a00d900a405f92598f9a2acea62486cfb6b46dd1

Contents?: true

Size: 1020 Bytes

Versions: 4

Compression:

Stored size: 1020 Bytes

Contents

# -*- coding: UTF-8 -*-
#
# Copyright 2014 PagerDuty, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

require 'octokit'

module LitaGithub
  # Github handler common-use Octokit methods
  module Octo
    # pull the access token from the config
    def access_token
      config.access_token
    end

    # set up the Octokit client
    def setup_octo(_)
      @@octo ||= Octokit::Client.new(access_token: access_token)
    end

    # object access method for Octokit client
    def octo
      @@octo
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lita-github-0.0.4 lib/lita-github/octo.rb
lita-github-0.0.3 lib/lita-github/octo.rb
lita-github-0.0.2 lib/lita-github/octo.rb
lita-github-0.0.1 lib/lita-github/octo.rb