class DevTraining::Repository
Class representing the training progress repository, lazily instantiated. It is the context that a number of the other objects in this app act within, and as such, a number of them take an instance of this class as an initialization parameter:
Constants
- NAME
Public Class Methods
Source
# File lib/dev_training/repository.rb, line 20 def initialize(client) @client = client @repo = Octokit::Repository.new owner: @client.user.login, name: NAME end
Takes an Octokit::Client
Public Instance Methods
Source
# File lib/dev_training/repository.rb, line 27 def add_collaborator(login) @client.add_collaborator(resource.full_name, login) end
Add the GitHub user, login
as an outside collaborator on the repository.
Source
# File lib/dev_training/repository.rb, line 34 def resource @resource ||= (repo? ? repo : create_repo) end
The Sawyer::Resource
representing the repository. It will be found by name, or created if not found for the authenticated user.