Class: Hookers::Git::Commit

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, author, message) ⇒ Commit

Returns a new instance of Commit.



8
9
10
11
12
# File 'lib/hookers/git/commit.rb', line 8

def initialize(id, author, message)
  self.id = id
  self.author = author
  self.message = message
end

Instance Attribute Details

#authorObject

Returns the value of attribute author.



6
7
8
# File 'lib/hookers/git/commit.rb', line 6

def author
  @author
end

#idObject

Returns the value of attribute id.



6
7
8
# File 'lib/hookers/git/commit.rb', line 6

def id
  @id
end

#messageObject

Returns the value of attribute message.



6
7
8
# File 'lib/hookers/git/commit.rb', line 6

def message
  @message
end

Instance Method Details

#to_xmlObject



14
15
16
17
18
19
20
# File 'lib/hookers/git/commit.rb', line 14

def to_xml
  "<source_commit>
    <commit_id> #{ self.id } </commit_id>
    <author> #{ CGI::escapeHTML(self.author) } </author>
    <message> #{ CGI::escapeHTML(self.message) } </message>
  </source_commit>"
end