Class: Gollum::Git::Commit

Inherits:
Object
  • Object
show all
Defined in:
lib/rugged_adapter/git_layer_rugged.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(commit) ⇒ Commit

Returns a new instance of Commit.



96
97
98
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 96

def initialize(commit)
  @commit = commit
end

Instance Attribute Details

#commitObject (readonly)

Returns the value of attribute commit.



106
107
108
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 106

def commit
  @commit
end

Instance Method Details

#authorObject



108
109
110
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 108

def author
  @author ||= Gollum::Git::Actor.new(@commit.author[:name], @commit.author[:email])
end

#authored_dateObject



112
113
114
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 112

def authored_date
  @commit.author[:time]
end

#idObject Also known as: sha, to_s



100
101
102
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 100

def id
  @commit.oid
end

#messageObject



116
117
118
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 116

def message
  @commit.message
end

#statsObject



124
125
126
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 124

def stats
  @stats ||= build_stats
end

#treeObject



120
121
122
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 120

def tree
  Gollum::Git::Tree.new(@commit.tree)
end