Class: Git::BlameColor::Commit
- Inherits:
-
Object
- Object
- Git::BlameColor::Commit
- Defined in:
- lib/git-blame-color/commit.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
readonly
Returns the value of attribute author.
-
#edited_line ⇒ Object
readonly
Returns the value of attribute edited_line.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
-
#line_number ⇒ Object
readonly
Returns the value of attribute line_number.
-
#summary ⇒ Object
readonly
Returns the value of attribute summary.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#timezone ⇒ Object
readonly
Returns the value of attribute timezone.
Instance Method Summary collapse
- #boundary? ⇒ Boolean
-
#initialize(block) ⇒ Commit
constructor
A new instance of Commit.
Constructor Details
#initialize(block) ⇒ Commit
Returns a new instance of Commit.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/git-blame-color/commit.rb', line 9 def initialize(block) @hash = block[0].split(' ')[0] @line_number = block[0].split(' ')[2].to_i @author = find_key(block, 'author').value @email = find_key(block, 'author-mail').value.gsub(/[<>]/, '') @timestamp = find_key(block, 'author-time').value.to_i @timezone = find_key(block, 'author-tz').value @summary = find_key(block, 'summary').value @edited_line = block.last.gsub(/^\t/, '') @is_boundary = !find_key(block, 'boundary').nil? end |
Instance Attribute Details
#author ⇒ Object (readonly)
Returns the value of attribute author.
7 8 9 |
# File 'lib/git-blame-color/commit.rb', line 7 def @author end |
#edited_line ⇒ Object (readonly)
Returns the value of attribute edited_line.
7 8 9 |
# File 'lib/git-blame-color/commit.rb', line 7 def edited_line @edited_line end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
7 8 9 |
# File 'lib/git-blame-color/commit.rb', line 7 def email @email end |
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
7 8 9 |
# File 'lib/git-blame-color/commit.rb', line 7 def hash @hash end |
#line_number ⇒ Object (readonly)
Returns the value of attribute line_number.
7 8 9 |
# File 'lib/git-blame-color/commit.rb', line 7 def line_number @line_number end |
#summary ⇒ Object (readonly)
Returns the value of attribute summary.
7 8 9 |
# File 'lib/git-blame-color/commit.rb', line 7 def summary @summary end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
7 8 9 |
# File 'lib/git-blame-color/commit.rb', line 7 def @timestamp end |
#timezone ⇒ Object (readonly)
Returns the value of attribute timezone.
7 8 9 |
# File 'lib/git-blame-color/commit.rb', line 7 def timezone @timezone end |
Instance Method Details
#boundary? ⇒ Boolean
21 22 23 |
# File 'lib/git-blame-color/commit.rb', line 21 def boundary? @is_boundary end |