Class: KCommercial::KCPipeline::KCCommit

Inherits:
Object
  • Object
show all
Defined in:
lib/KCommercialPipeline/core/branch_diffs.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ KCCommit

Returns a new instance of KCCommit.



33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/KCommercialPipeline/core/branch_diffs.rb', line 33

def initialize(data)
   data_c = data.clone
   data_c.delete("sha")
   data_c.delete("message")
   @ori_commit_id = data["sha"].chomp
   @commit_id = Digest::SHA1.hexdigest(data_c.to_s)
   @sha = data["sha"].chomp
   @message = data["message"].chomp
   @parent = data["parent"]
   @author_info = data["Author:"].chomp
   @author = GitAuthor.new(data["Author:"].chomp)
   @date = Time.parse(data["Date:"]).to_s.chomp
end

Instance Attribute Details

#authorObject

Returns the value of attribute author.



29
30
31
# File 'lib/KCommercialPipeline/core/branch_diffs.rb', line 29

def author
  @author
end

#author_infoObject

Returns the value of attribute author_info.



30
31
32
# File 'lib/KCommercialPipeline/core/branch_diffs.rb', line 30

def author_info
  @author_info
end

#commit_idObject

Returns the value of attribute commit_id.



24
25
26
# File 'lib/KCommercialPipeline/core/branch_diffs.rb', line 24

def commit_id
  @commit_id
end

#dateObject

Returns the value of attribute date.



31
32
33
# File 'lib/KCommercialPipeline/core/branch_diffs.rb', line 31

def date
  @date
end

#messageObject

Returns the value of attribute message.



27
28
29
# File 'lib/KCommercialPipeline/core/branch_diffs.rb', line 27

def message
  @message
end

#ori_commit_idObject

Returns the value of attribute ori_commit_id.



25
26
27
# File 'lib/KCommercialPipeline/core/branch_diffs.rb', line 25

def ori_commit_id
  @ori_commit_id
end

#parentObject

Returns the value of attribute parent.



28
29
30
# File 'lib/KCommercialPipeline/core/branch_diffs.rb', line 28

def parent
  @parent
end

#shaObject

Returns the value of attribute sha.



26
27
28
# File 'lib/KCommercialPipeline/core/branch_diffs.rb', line 26

def sha
  @sha
end