Class: Evertils::Common::Query::Backup
- Defined in:
- lib/evertils/common/query/backup.rb
Overview
Instance Method Summary collapse
Methods inherited from Base
Methods inherited from Generic
#bytesize, #deprecation_notice, #encoding, #force_encoding, #has_required_fields, #initialize
Constructor Details
This class inherits a constructor from Evertils::Common::Generic
Instance Method Details
#expunge! ⇒ Object
25 26 27 |
# File 'lib/evertils/common/query/backup.rb', line 25 def expunge! @entity.expunge! end |
#files(*files) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/evertils/common/query/backup.rb', line 7 def files(*files) date = DateTime.now backup_notebook_name = 'Backup' nm = Entity::Note.new # create the backup notebook if it does not exist nb_entity = Entity::Notebook.new nb = nb_entity.find(backup_notebook_name) if nb_entity.find(backup_notebook_name).nil? nb = nb_entity.create(backup_notebook_name) end @entity = nm.create(title: "Backup: #{date}", body: "", parent_notebook: nb, files: files) end |