Preconfigured Models

If you have several Models that will always contain the same components, you can preconfigure custom Models.

In your config.rb, below your Component Defaults:

preconfigure 'MyModel' do

  archive :user_pictures do |archive|
    archive.add '~/pictures'
  end

  notify_by Mail do |mail|
    mail.to = '[email protected]'
  end

end

You can now create multiple Models that will archive ~/pictures, and notify you by mail.

MyModel.new(:john_smith, 'John Smith Backup') do

  archive :user_music do |archive|
    archive.add '~/music'
  end

  notify_by Mail do |mail|
    mail.to = '[email protected]'
  end

end

John Smith’s backup will archive his ~/pictures and ~/music directories.
It will then send a notification to both [email protected] and [email protected].

MyModel.new(:mary_joe, 'Mary Joe Backup') do

  archive :user_documents do |archive|
    archive.add '~/documents'
  end

  notify_by Mail do |mail|
    mail.to = '[email protected]'
  end

end

Mary Joe’s backup will archive her ~/pictures and ~/documents directories.
It will then send a notification to both [email protected] and [email protected].

It’s important to understand that components you add within your Model will add to the preconfigured components.
There are a few exceptions:

Any of these used within your Model definition will override a preconfigured setting.