Class: Github::Repo
- Inherits:
-
Object
- Object
- Github::Repo
- Defined in:
- lib/github/repo.rb
Instance Attribute Summary collapse
-
#info ⇒ Object
readonly
Returns the value of attribute info.
Instance Method Summary collapse
- #access_token ⇒ Object
- #commits ⇒ Object
- #commits_url ⇒ Object
- #forked? ⇒ Boolean
-
#initialize(repo_info, token) ⇒ Repo
constructor
A new instance of Repo.
- #language ⇒ Object
- #languages ⇒ Object
- #languages_url ⇒ Object
- #name ⇒ Object
- #owner_login ⇒ Object
- #url ⇒ Object
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
#info ⇒ Object (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_token ⇒ Object
38 39 40 |
# File 'lib/github/repo.rb', line 38 def access_token self.info['access_token'] end |
#commits ⇒ Object
42 43 44 |
# File 'lib/github/repo.rb', line 42 def commits request(commits_url, access_token) end |
#commits_url ⇒ Object
30 31 32 |
# File 'lib/github/repo.rb', line 30 def commits_url @info['commits_url'].split('{')[0] end |
#forked? ⇒ Boolean
22 23 24 |
# File 'lib/github/repo.rb', line 22 def forked? @info['fork'] end |
#language ⇒ Object
10 11 12 |
# File 'lib/github/repo.rb', line 10 def language @info['language'] end |
#languages ⇒ Object
46 47 48 |
# File 'lib/github/repo.rb', line 46 def languages request(languages_url, access_token) end |
#languages_url ⇒ Object
34 35 36 |
# File 'lib/github/repo.rb', line 34 def languages_url @info['languages_url'] end |
#name ⇒ Object
14 15 16 |
# File 'lib/github/repo.rb', line 14 def name @info['name'] end |
#owner_login ⇒ Object
18 19 20 |
# File 'lib/github/repo.rb', line 18 def owner_login @info['owner']['login'] end |
#url ⇒ Object
26 27 28 |
# File 'lib/github/repo.rb', line 26 def url @info['html_url'] end |