Class: Codeowners::Git::Contributor

Inherits:
Object
  • Object
show all
Defined in:
lib/codeowners/git/contributor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#deletionsObject (readonly)

Returns the value of attribute deletions.



6
7
8
# File 'lib/codeowners/git/contributor.rb', line 6

def deletions
  @deletions
end

#emailObject (readonly)

Returns the value of attribute email.



6
7
8
# File 'lib/codeowners/git/contributor.rb', line 6

def email
  @email
end

#fileObject (readonly)

Returns the value of attribute file.



6
7
8
# File 'lib/codeowners/git/contributor.rb', line 6

def file
  @file
end

#insertionsObject (readonly)

Returns the value of attribute insertions.



6
7
8
# File 'lib/codeowners/git/contributor.rb', line 6

def insertions
  @insertions
end

#nameObject (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_csvObject



22
23
24
# File 'lib/codeowners/git/contributor.rb', line 22

def to_csv
  "#{name}, #{email}, #{insertions}, #{deletions}"
end

#to_sObject



18
19
20
# File 'lib/codeowners/git/contributor.rb', line 18

def to_s
  "#{name} <#{email}> / +#{insertions}, -#{deletions}"
end