Method: Doing::WWID#repeat_last

Defined in:
lib/doing/wwid/modify.rb

#repeat_last(opt) ⇒ Object

Restart the last entry

Parameters:

  • opt (Hash)

    Additional Options



144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/doing/wwid/modify.rb', line 144

def repeat_last(opt)
  opt ||= {}
  opt[:section] ||= 'all'
  opt[:section] = guess_section(opt[:section])
  opt[:note] ||= []
  opt[:tag] ||= []
  opt[:tag_bool] ||= :and

  last = last_entry(opt)
  if last.nil?
    logger.warn('Skipped:', 'No previous entry found')
    return
  end

  repeat_item(last, opt)
  write(@doing_file)
end