class TimeCost::AuthorList
Public Class Methods
new()
click to toggle source
Prepare an empty index (local)
# File lib/timecost/author_list.rb, line 9 def initialize @count = 0 @author_to_id = {} end
Public Instance Methods
add(author)
click to toggle source
# File lib/timecost/author_list.rb, line 14 def add author if @author_to_id.include? author then result = @author_to_id[author] else @author_to_id[author] = @count result = @count @count += 1 end end
alias(author_ref, author_new)
click to toggle source
# File lib/timecost/author_list.rb, line 24 def alias author_ref, author_new raise UnknownAuthor unless @author_to_id.include? author_ref end
parse(author)
click to toggle source
Return local user id for git user FIXME: should handle multiple names for same user
# File lib/timecost/author_list.rb, line 30 def parse author return @author_to_id[author] end
size()
click to toggle source
# File lib/timecost/author_list.rb, line 34 def size return @author_to_id.keys.size end