Method: Notes#tag

Defined in:
lib/cnote/notes.rb

#tag(params) ⇒ Object



207
208
209
210
211
212
213
214
215
216
217
218
219
220
# File 'lib/cnote/notes.rb', line 207

def tag(params)
  notes = multi_note(params)

  notes.each do |note|
    tags = params.slice(1, params.length)
    note.add_tags(tags)
  end

  print_list("Changed", notes)

  @filtered = notes

  puts "Added #{params.length - 1} tag#{"s" if params.length != 2} to #{notes.length} note#{"s" if notes.length != 1}."
end