Class: GoApiClient::Commit
- Inherits:
-
Object
- Object
- GoApiClient::Commit
- Includes:
- Helpers::SimpleAttributesSupport
- Defined in:
- lib/go_api_client/commit.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
Returns the value of attribute message.
-
#revision ⇒ Object
Returns the value of attribute revision.
-
#time ⇒ Object
Returns the value of attribute time.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(root, attributes = {}) ⇒ Commit
constructor
A new instance of Commit.
- #parse! ⇒ Object
- #to_s ⇒ Object
Constructor Details
Instance Attribute Details
#message ⇒ Object
Returns the value of attribute message.
4 5 6 |
# File 'lib/go_api_client/commit.rb', line 4 def @message end |
#revision ⇒ Object
Returns the value of attribute revision.
4 5 6 |
# File 'lib/go_api_client/commit.rb', line 4 def revision @revision end |
#time ⇒ Object
Returns the value of attribute time.
4 5 6 |
# File 'lib/go_api_client/commit.rb', line 4 def time @time end |
#user ⇒ Object
Returns the value of attribute user.
4 5 6 |
# File 'lib/go_api_client/commit.rb', line 4 def user @user end |
Instance Method Details
#parse! ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/go_api_client/commit.rb', line 13 def parse! self.revision = @root.xpath("./revision").first.content self. = @root.xpath("./message").first.content self.time = Time.parse(@root.xpath("./checkinTime").first.content).utc self.user = User.parse(@root.xpath("./user").first.content) @root = nil self end |
#to_s ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/go_api_client/commit.rb', line 22 def to_s "commit #{revision} Author: #{user} Date: #{time} #{.each_line.collect {|l| " #{l}"}}" end |