Class: Github::Repo

Inherits:
Object
  • Object
show all
Defined in:
lib/github/repo.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(repo_info, token) ⇒ Repo

Returns a new instance of Repo.



5
6
7
8
# File 'lib/github/repo.rb', line 5

def initialize(repo_info, token)
	store(repo_info)
	store_token(token)
end

Instance Attribute Details

#infoObject (readonly)

Returns the value of attribute info.



3
4
5
# File 'lib/github/repo.rb', line 3

def info
  @info
end

Instance Method Details

#access_tokenObject



38
39
40
# File 'lib/github/repo.rb', line 38

def access_token
	self.info['access_token']
end

#commitsObject



42
43
44
# File 'lib/github/repo.rb', line 42

def commits
	request(commits_url, access_token)
end

#commits_urlObject



30
31
32
# File 'lib/github/repo.rb', line 30

def commits_url 
	@info['commits_url'].split('{')[0]
end

#forked?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/github/repo.rb', line 22

def forked?
	@info['fork']
end

#languageObject



10
11
12
# File 'lib/github/repo.rb', line 10

def language
	@info['language']
end

#languagesObject



46
47
48
# File 'lib/github/repo.rb', line 46

def languages
	request(languages_url, access_token)
end

#languages_urlObject



34
35
36
# File 'lib/github/repo.rb', line 34

def languages_url
	@info['languages_url']
end

#nameObject



14
15
16
# File 'lib/github/repo.rb', line 14

def name 
	@info['name']
end

#owner_loginObject



18
19
20
# File 'lib/github/repo.rb', line 18

def 
	@info['owner']['login']
end

#urlObject



26
27
28
# File 'lib/github/repo.rb', line 26

def url
	@info['html_url']
end