class Perkins::Commit
Attributes
branch[RW]
sha[R]
Public Class Methods
new(sha, repo)
click to toggle source
# File lib/perkins/commit.rb, line 7 def initialize(sha, repo) return if sha.nil? @commit = repo.git.gcommit(sha) @sha = sha end
Public Instance Methods
as_json(opts={})
click to toggle source
# File lib/perkins/commit.rb, line 29 def as_json(opts={}) data = {} fields = [:author, :email, :created_at, :message, :sha] fields.each{|f| data[f] = send(f)} data end
created_at()
click to toggle source
# File lib/perkins/commit.rb, line 21 def created_at @commit.author.date unless @commit.blank? end
email()
click to toggle source
# File lib/perkins/commit.rb, line 17 def email @commit.author.email unless @commit.blank? end
message()
click to toggle source
# File lib/perkins/commit.rb, line 25 def message @commit.message unless @commit.blank? end