Class: Git::Author

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(author_string) ⇒ Author

Returns a new instance of Author.


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

def initialize(author_string)
  if m = /(.*?) <(.*?)> (\d+) (.*)/.match(author_string)
    @name = m[1]
    @email = m[2]
    @date = Time.at(m[3].to_i)
  end
end

Instance Attribute Details

#date

Returns the value of attribute date.


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

def date
  @date
end

#email

Returns the value of attribute email.


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

def email
  @email
end

#name

Returns the value of attribute name.


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

def name
  @name
end