Class: Author
- Inherits:
-
Object
- Object
- Author
- Defined in:
- lib/ginbeer/author.rb
Instance Attribute Summary collapse
-
#commit_count ⇒ Object
Returns the value of attribute commit_count.
-
#deletion ⇒ Object
Returns the value of attribute deletion.
-
#insertion ⇒ Object
Returns the value of attribute insertion.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, commit_count) ⇒ Author
constructor
A new instance of Author.
- #result ⇒ Object
- #score ⇒ Object
Constructor Details
#initialize(name, commit_count) ⇒ Author
Returns a new instance of Author.
4 5 6 7 8 9 |
# File 'lib/ginbeer/author.rb', line 4 def initialize(name, commit_count) @name = name @commit_count = commit_count @insertion = 0 @deletion = 0 end |
Instance Attribute Details
#commit_count ⇒ Object
Returns the value of attribute commit_count.
2 3 4 |
# File 'lib/ginbeer/author.rb', line 2 def commit_count @commit_count end |
#deletion ⇒ Object
Returns the value of attribute deletion.
2 3 4 |
# File 'lib/ginbeer/author.rb', line 2 def deletion @deletion end |
#insertion ⇒ Object
Returns the value of attribute insertion.
2 3 4 |
# File 'lib/ginbeer/author.rb', line 2 def insertion @insertion end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/ginbeer/author.rb', line 2 def name @name end |
Instance Method Details
#result ⇒ Object
15 16 17 |
# File 'lib/ginbeer/author.rb', line 15 def result return "#{self.name}: #{self.score}(commits: #{self.commit_count}, insertion: #{self.insertion}, deletion: #{self.deletion})" end |
#score ⇒ Object
11 12 13 |
# File 'lib/ginbeer/author.rb', line 11 def score return @commit_count + @insertion + @deletion end |