Class: Git::Author
- Inherits:
-
Object
- Object
- Git::Author
- Defined in:
- lib/git/author.rb
Overview
An author in a Git commit
Instance Attribute Summary collapse
-
#date ⇒ Time?
The date the change was authored (author date, not committer date).
-
#email ⇒ String?
The author's email.
-
#name ⇒ String?
The author's name.
Instance Method Summary collapse
-
#initialize(author_string)
constructor
Initializes a new Author object from a string.
Constructor Details
#initialize(author_string)
Initializes a new Author object from a string
27 28 29 30 31 32 33 |
# File 'lib/git/author.rb', line 27 def initialize() return unless (m = /(.*?) <(.*?)> (\d+) (.*)/.match()) @name = m[1] @email = m[2] @date = Time.at(m[3].to_i) end |
Instance Attribute Details
#date ⇒ Time?
Returns the date the change was authored (author date, not committer date).
16 17 18 |
# File 'lib/git/author.rb', line 16 def date @date end |
#email ⇒ String?
Returns the author's email.
13 14 15 |
# File 'lib/git/author.rb', line 13 def email @email end |
#name ⇒ String?
Returns the author's name.
10 11 12 |
# File 'lib/git/author.rb', line 10 def name @name end |