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.



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

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

#dateObject

Returns the value of attribute date.



3
4
5
# File 'lib/git/author.rb', line 3

def date
  @date
end

#emailObject

Returns the value of attribute email.



3
4
5
# File 'lib/git/author.rb', line 3

def email
  @email
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/git/author.rb', line 3

def name
  @name
end