Class: Codeowners::Git::Contributor
- Inherits:
-
Object
- Object
- Codeowners::Git::Contributor
- Defined in:
- lib/codeowners/git/contributor.rb
Instance Attribute Summary collapse
-
#deletions ⇒ Object
readonly
Returns the value of attribute deletions.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#insertions ⇒ Object
readonly
Returns the value of attribute insertions.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(email, name, file, insertions, deletions) ⇒ Contributor
constructor
A new instance of Contributor.
- #to_csv ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(email, name, file, insertions, deletions) ⇒ Contributor
Returns a new instance of Contributor.
8 9 10 11 12 13 14 15 16 |
# File 'lib/codeowners/git/contributor.rb', line 8 def initialize(email, name, file, insertions, deletions) @email = email @name = name @file = file @insertions = insertions @deletions = deletions freeze end |
Instance Attribute Details
#deletions ⇒ Object (readonly)
Returns the value of attribute deletions.
6 7 8 |
# File 'lib/codeowners/git/contributor.rb', line 6 def deletions @deletions end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
6 7 8 |
# File 'lib/codeowners/git/contributor.rb', line 6 def email @email end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
6 7 8 |
# File 'lib/codeowners/git/contributor.rb', line 6 def file @file end |
#insertions ⇒ Object (readonly)
Returns the value of attribute insertions.
6 7 8 |
# File 'lib/codeowners/git/contributor.rb', line 6 def insertions @insertions end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/codeowners/git/contributor.rb', line 6 def name @name end |
Instance Method Details
#to_csv ⇒ Object
22 23 24 |
# File 'lib/codeowners/git/contributor.rb', line 22 def to_csv "#{name}, #{email}, #{insertions}, #{deletions}" end |
#to_s ⇒ Object
18 19 20 |
# File 'lib/codeowners/git/contributor.rb', line 18 def to_s "#{name} <#{email}> / +#{insertions}, -#{deletions}" end |