Class: GitReporting::Commit

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Commit

Returns a new instance of Commit.



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

def initialize(attrs = {})
  @time = 0
  attrs.each do |key, value|
    send "#{key}=", value
  end
end

Instance Attribute Details

#authorObject

Returns the value of attribute author.



6
7
8
# File 'lib/git_reporting/commit.rb', line 6

def author
  @author
end

#messageObject

Returns the value of attribute message.



6
7
8
# File 'lib/git_reporting/commit.rb', line 6

def message
  @message
end

#shaObject

Returns the value of attribute sha.



6
7
8
# File 'lib/git_reporting/commit.rb', line 6

def sha
  @sha
end

#timeObject

Returns the value of attribute time.



6
7
8
# File 'lib/git_reporting/commit.rb', line 6

def time
  @time
end

#timestampObject

Returns the value of attribute timestamp.



6
7
8
# File 'lib/git_reporting/commit.rb', line 6

def timestamp
  @timestamp
end

Instance Method Details

#to_sObject



21
22
23
# File 'lib/git_reporting/commit.rb', line 21

def to_s
  "Commit #{sha}"
end