1 # Files and folders can be stored temporary on the clipboard.
2 # Objects are not persisted to the database as the nature of a clipboard object
3 # is that it's temporary.
8 # Initialize clipboard object.
9 # We're starting with an empty clipboard:
10 # the @folders and @files arrays are empty too.
16 # Put given folder on clipboard
17 # unless it's already there
18 def add_folder(folder)
19 @folders << folder unless @folders.find{ |f| f.id == folder.id }
22 # Put given file on clipboard
23 # unless it's already there
25 @files << file unless @files.find{ |f| f.id == file.id }
28 # Remove given folder from clipboard
29 def remove_folder(folder)
30 @folders.delete(folder)
33 # Remove given file from clipboard