Class: Commit

Inherits:
Object
  • Object
show all
Defined in:
lib/worth/commit.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(author, message, changes) ⇒ Commit

Returns a new instance of Commit.



9
10
11
12
13
# File 'lib/worth/commit.rb', line 9

def initialize(author, message, changes)
  @author = author
  @message = message
  @changes = changes
end

Instance Attribute Details

#authorObject (readonly)

Returns the value of attribute author.



7
8
9
# File 'lib/worth/commit.rb', line 7

def author
  @author
end

#changesObject (readonly)

Returns the value of attribute changes.



7
8
9
# File 'lib/worth/commit.rb', line 7

def changes
  @changes
end

#messageObject (readonly)

Returns the value of attribute message.



7
8
9
# File 'lib/worth/commit.rb', line 7

def message
  @message
end

Class Method Details

.headingObject



3
4
5
# File 'lib/worth/commit.rb', line 3

def self.heading
  "author,message,weight"
end

Instance Method Details

#to_csvObject



15
16
17
# File 'lib/worth/commit.rb', line 15

def to_csv
  "#{author},#{message},#{weight}" if relevant?
end