Sha256: ca14784dd91be5d3ad1dfe0bbb3f5e4015162a867c275ec79eb2ca87c29332d3

Contents?: true

Size: 542 Bytes

Versions: 1

Compression:

Stored size: 542 Bytes

Contents

module YOLOBackup
  class Server
    OPTIONS = %w{ excludes rotation ssh_host ssh_key ssh_port ssh_user storage }

    OPTIONS.each do |option|
      attr_accessor option
    end

    attr_reader :name

    def initialize(name, options)
      @name = name
      OPTIONS.each do |option|
        send("#{option}=", options[option]) if options.key?(option)
      end
    end

    def latest_backup
      storage.latest_backup(self)
    end

    def cleanup_backups
      storage.cleanup(self)
    end

    def to_s
      name
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
yolo_backup-0.0.0 lib/yolo_backup/server.rb