Class: Faf::Repo
- Inherits:
-
Object
- Object
- Faf::Repo
- Defined in:
- lib/faf/repo.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#owner ⇒ Object
readonly
Returns the value of attribute owner.
-
#pushed_at ⇒ Object
readonly
Returns the value of attribute pushed_at.
Instance Method Summary collapse
- #fork_count ⇒ Object
- #forks ⇒ Object
-
#initialize(url, options = {}) ⇒ Repo
constructor
A new instance of Repo.
- #repository ⇒ Object
- #to_s ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(url, options = {}) ⇒ Repo
Returns a new instance of Repo.
7 8 9 10 |
# File 'lib/faf/repo.rb', line 7 def initialize(url, = {}) @owner, @name = url.split('/', 2) @pushed_at = [:pushed_at] end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/faf/repo.rb', line 4 def name @name end |
#owner ⇒ Object (readonly)
Returns the value of attribute owner.
3 4 5 |
# File 'lib/faf/repo.rb', line 3 def owner @owner end |
#pushed_at ⇒ Object (readonly)
Returns the value of attribute pushed_at.
5 6 7 |
# File 'lib/faf/repo.rb', line 5 def pushed_at @pushed_at end |
Instance Method Details
#fork_count ⇒ Object
16 17 18 |
# File 'lib/faf/repo.rb', line 16 def fork_count repository.fork_count end |
#forks ⇒ Object
12 13 14 |
# File 'lib/faf/repo.rb', line 12 def forks @forks ||= Faf::Forks.new(self) end |
#repository ⇒ Object
20 21 22 |
# File 'lib/faf/repo.rb', line 20 def repository data.repository end |
#to_s ⇒ Object
28 29 30 |
# File 'lib/faf/repo.rb', line 28 def to_s "#{url} (#{pushed_at.ago_in_words})" end |
#url ⇒ Object
24 25 26 |
# File 'lib/faf/repo.rb', line 24 def url "https://github.com/#{owner}/#{name}" end |