Class: BBNW::Commit
- Inherits:
-
Object
- Object
- BBNW::Commit
- Defined in:
- lib/adapters/base/commit.rb
Instance Attribute Summary collapse
-
#commit_id ⇒ Object
readonly
Returns the value of attribute commit_id.
-
#committer ⇒ Object
readonly
Returns the value of attribute committer.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#total_changes ⇒ Object
readonly
Returns the value of attribute total_changes.
Instance Method Summary collapse
- #activity ⇒ Object
- #end_time ⇒ Object
-
#initialize(commit_id, message, committer, timestamp, total_changes = 0) ⇒ Commit
constructor
A new instance of Commit.
- #start_time ⇒ Object
-
#task_id ⇒ Object
Looks for an integer > 5 chars as the task_id.
Constructor Details
#initialize(commit_id, message, committer, timestamp, total_changes = 0) ⇒ Commit
Returns a new instance of Commit.
7 8 9 10 11 12 13 |
# File 'lib/adapters/base/commit.rb', line 7 def initialize(commit_id, , committer, , total_changes = 0) @commit_id = commit_id @message = @committer = committer @timestamp = .is_a?(String) ? Time.parse() : @total_changes = total_changes end |
Instance Attribute Details
#commit_id ⇒ Object (readonly)
Returns the value of attribute commit_id.
5 6 7 |
# File 'lib/adapters/base/commit.rb', line 5 def commit_id @commit_id end |
#committer ⇒ Object (readonly)
Returns the value of attribute committer.
5 6 7 |
# File 'lib/adapters/base/commit.rb', line 5 def committer @committer end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
5 6 7 |
# File 'lib/adapters/base/commit.rb', line 5 def @message end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
5 6 7 |
# File 'lib/adapters/base/commit.rb', line 5 def @timestamp end |
#total_changes ⇒ Object (readonly)
Returns the value of attribute total_changes.
5 6 7 |
# File 'lib/adapters/base/commit.rb', line 5 def total_changes @total_changes end |
Instance Method Details
#activity ⇒ Object
21 22 23 |
# File 'lib/adapters/base/commit.rb', line 21 def activity @message end |
#end_time ⇒ Object
18 19 20 |
# File 'lib/adapters/base/commit.rb', line 18 def end_time @timestamp end |
#start_time ⇒ Object
15 16 17 |
# File 'lib/adapters/base/commit.rb', line 15 def start_time @timestamp end |
#task_id ⇒ Object
Looks for an integer > 5 chars as the task_id
25 26 27 28 29 30 |
# File 'lib/adapters/base/commit.rb', line 25 def task_id if =~ /(\d{6,})/ return $1.to_i end nil end |