class Synco::Method

A backup method provides the interface to copy data from one system to another.

Attributes

arguments[R]
options[R]

Public Class Methods

new(*command, arguments: [], **options) click to toggle source
Calls superclass method Synco::Controller::new
# File lib/synco/method.rb, line 33
def initialize(*command, arguments: [], **options)
        super()
        
        @command = command.empty? ? default_command : command
        @arguments = arguments
        @options = options
end

Public Instance Methods

call(scope, arguments: []) click to toggle source
# File lib/synco/method.rb, line 44
def call(scope, arguments: [])
        server = scope.current_server
        directory = scope.directory
        
        server.run(
                *@command,
                *arguments,
                scope.master_server.connection_string(directory, on: server),
                scope.target_server.connection_string(directory, on: server)
        )
end