Class: Git::GitCommit

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sha, message, commit_date, author_name, author_email, repository_name:) ⇒ GitCommit

Returns a new instance of GitCommit.



7
8
9
10
11
12
13
14
# File 'lib/git/git_commit.rb', line 7

def initialize(sha, message, commit_date, author_name, author_email, repository_name:)
  @sha = sha
  @message = message
  @commit_date = commit_date
  @author_email = author_email
  @author_name = author_name
  @repository_name = repository_name
end

Instance Attribute Details

#author_emailObject (readonly)

Returns the value of attribute author_email.



5
6
7
# File 'lib/git/git_commit.rb', line 5

def author_email
  @author_email
end

#author_nameObject (readonly)

Returns the value of attribute author_name.



5
6
7
# File 'lib/git/git_commit.rb', line 5

def author_name
  @author_name
end

#commit_dateObject (readonly)

Returns the value of attribute commit_date.



5
6
7
# File 'lib/git/git_commit.rb', line 5

def commit_date
  @commit_date
end

#messageObject (readonly)

Returns the value of attribute message.



5
6
7
# File 'lib/git/git_commit.rb', line 5

def message
  @message
end

#repository_nameObject (readonly)

Returns the value of attribute repository_name.



5
6
7
# File 'lib/git/git_commit.rb', line 5

def repository_name
  @repository_name
end

#shaObject (readonly)

Returns the value of attribute sha.



5
6
7
# File 'lib/git/git_commit.rb', line 5

def sha
  @sha
end

Instance Method Details

#==(other) ⇒ Object



20
21
22
# File 'lib/git/git_commit.rb', line 20

def ==(other)
  sha == other.sha
end

#to_sObject



16
17
18
# File 'lib/git/git_commit.rb', line 16

def to_s
  sha
end