Class: GitHack::Commit

Inherits:
Object
  • Object
show all
Defined in:
lib/git-hack/commit.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Commit

Returns a new instance of Commit.



8
9
10
11
12
13
14
15
# File 'lib/git-hack/commit.rb', line 8

def initialize(hash)
	@sha = hash['sha']
	@message = hash['message']
	@parent = hash['parent']
	@tree = hash['tree']
	@author = hash['author']
	@committer = hash['committer']
end

Instance Attribute Details

#authorObject

Returns the value of attribute author.



7
8
9
# File 'lib/git-hack/commit.rb', line 7

def author
  @author
end

#committerObject

Returns the value of attribute committer.



7
8
9
# File 'lib/git-hack/commit.rb', line 7

def committer
  @committer
end

#messageObject

Returns the value of attribute message.



7
8
9
# File 'lib/git-hack/commit.rb', line 7

def message
  @message
end

#parentObject

Returns the value of attribute parent.



7
8
9
# File 'lib/git-hack/commit.rb', line 7

def parent
  @parent
end

#shaObject

Returns the value of attribute sha.



7
8
9
# File 'lib/git-hack/commit.rb', line 7

def sha
  @sha
end

#treeObject

Returns the value of attribute tree.



7
8
9
# File 'lib/git-hack/commit.rb', line 7

def tree
  @tree
end