Method: TimeCost::AuthorList#add

Defined in:
lib/timecost/author_list.rb

#add(author) ⇒ Object



14
15
16
17
18
19
20
21
22
# 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