Class: Lsgh::Repository

Inherits:
Object
  • Object
show all
Defined in:
lib/lsgh/repository.rb

Instance Method Summary collapse

Constructor Details

#initialize(repo, client) ⇒ Repository

Returns a new instance of Repository.



3
4
5
6
# File 'lib/lsgh/repository.rb', line 3

def initialize(repo, client)
  @repo = repo
  @pull_requests = client.pull_requests.all(user: repo['owner']['login'], repo: repo['name'])
end

Instance Method Details

#to_pathsObject



8
9
10
11
12
13
14
15
# File 'lib/lsgh/repository.rb', line 8

def to_paths
  paths = [name]
  paths += pull_requests_paths.map do |path|
    "#{name}/#{path}"
  end

  paths
end

#typeObject



17
18
19
20
21
22
23
# File 'lib/lsgh/repository.rb', line 17

def type
  if @repo['private']
    :private
  else
    :public
  end
end