Class: Hubload::Repo
- Inherits:
-
Object
- Object
- Hubload::Repo
- Defined in:
- lib/hubload/repo.rb
Defined Under Namespace
Classes: Owner
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#fork ⇒ Object
Returns the value of attribute fork.
-
#forks ⇒ Object
Returns the value of attribute forks.
-
#homepage ⇒ Object
Returns the value of attribute homepage.
-
#name ⇒ Object
Returns the value of attribute name.
-
#open_issues ⇒ Object
Returns the value of attribute open_issues.
-
#owner ⇒ Object
Returns the value of attribute owner.
-
#publicly_visible ⇒ Object
Returns the value of attribute publicly_visible.
-
#url ⇒ Object
Returns the value of attribute url.
-
#watchers ⇒ Object
Returns the value of attribute watchers.
Instance Method Summary collapse
-
#fork? ⇒ Boolean
Returns true if the repo is a fork, false otherwise.
-
#initialize(repo) ⇒ Repo
constructor
A new instance of Repo.
-
#publicly_visible? ⇒ Boolean
Returns true if the repo is public, false otherwise.
Constructor Details
#initialize(repo) ⇒ Repo
Returns a new instance of Repo.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/hubload/repo.rb', line 7 def initialize(repo) @forks = repo['forks'] @description = repo['description'] @watchers = repo['watchers'] @open_issues = repo['open_issues'] @url = repo['url'] @fork = repo['fork'] @publicly_visible = !repo['private'] @homepage = repo['homepage'] @owner = Owner.new(repo['owner']['name'], repo['owner']['email']) @name = repo['name'] end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
4 5 6 |
# File 'lib/hubload/repo.rb', line 4 def description @description end |
#fork ⇒ Object
Returns the value of attribute fork.
4 5 6 |
# File 'lib/hubload/repo.rb', line 4 def fork @fork end |
#forks ⇒ Object
Returns the value of attribute forks.
4 5 6 |
# File 'lib/hubload/repo.rb', line 4 def forks @forks end |
#homepage ⇒ Object
Returns the value of attribute homepage.
4 5 6 |
# File 'lib/hubload/repo.rb', line 4 def homepage @homepage end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/hubload/repo.rb', line 4 def name @name end |
#open_issues ⇒ Object
Returns the value of attribute open_issues.
4 5 6 |
# File 'lib/hubload/repo.rb', line 4 def open_issues @open_issues end |
#owner ⇒ Object
Returns the value of attribute owner.
4 5 6 |
# File 'lib/hubload/repo.rb', line 4 def owner @owner end |
#publicly_visible ⇒ Object
Returns the value of attribute publicly_visible.
4 5 6 |
# File 'lib/hubload/repo.rb', line 4 def publicly_visible @publicly_visible end |
#url ⇒ Object
Returns the value of attribute url.
4 5 6 |
# File 'lib/hubload/repo.rb', line 4 def url @url end |
#watchers ⇒ Object
Returns the value of attribute watchers.
4 5 6 |
# File 'lib/hubload/repo.rb', line 4 def watchers @watchers end |
Instance Method Details
#fork? ⇒ Boolean
Returns true if the repo is a fork, false otherwise
26 27 28 |
# File 'lib/hubload/repo.rb', line 26 def fork? @fork end |
#publicly_visible? ⇒ Boolean
Returns true if the repo is public, false otherwise
21 22 23 |
# File 'lib/hubload/repo.rb', line 21 def publicly_visible? @publicly_visible end |