module EM::FTPD::FSD::Hooks

Add callbacks methods to base class. @example Usage

class BasicDriver
  include EM::FTPD::FSD::Base

  before :put_file, :some_method
  after :delete_file, :some_other_method

  def some_method( path, tmp_path )
    ...
  end

  def some_other_method( path, value )
    ...
  end
end

Public Instance Methods

after( command, method ) click to toggle source

Set a method to be called after FTP command is executed That method will be invoked with same arguments that FTP command and an extra parameter containig the value yielded by the FTP command @param [Symbol] command FTP command to be hooked @param [Symbol] method Method to be called after FTP command

# File lib/em-ftpd-fsd/hooks.rb, line 51
def after( command, method )
  after_hooks[command] = method
end
after_hooks() click to toggle source

Defined hooks to be executed after FTP commands @return [Array] List of methods to be called after FTP commands

# File lib/em-ftpd-fsd/hooks.rb, line 63
def after_hooks
  @after_hooks ||= {}
end
before( command, method ) click to toggle source

Set a method to be called before FTP command is executed That method will be invoked with same arguments that FTP command @param [Symbol] command FTP command to be hooked @param [Symbol] method Method to be called before FTP command

# File lib/em-ftpd-fsd/hooks.rb, line 42
def before( command, method )
  before_hooks[command] = method
end
before_hooks() click to toggle source

Defined hooks to be executed before FTP commands @return [Array] List of methods to be called before FTP commands

# File lib/em-ftpd-fsd/hooks.rb, line 57
def before_hooks
  @before_hooks ||= {}
end