Class: Git::Author

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

Overview

An author in a Git commit

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(author_string) ⇒ Author



8
9
10
11
12
13
14
# File 'lib/git/author.rb', line 8

def initialize(author_string)
  return unless (m = /(.*?) <(.*?)> (\d+) (.*)/.match(author_string))

  @name = m[1]
  @email = m[2]
  @date = Time.at(m[3].to_i)
end

Instance Attribute Details

#date

Returns the value of attribute date.



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

def date
  @date
end

#email

Returns the value of attribute email.



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

def email
  @email
end

#name

Returns the value of attribute name.



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

def name
  @name
end