Class: Ftpd::CommandHandler

Inherits:
Object
  • Object
show all
Extended by:
Forwardable, Memoizer
Includes:
DataConnectionHelper, Error, FileSystemHelper
Defined in:
lib/ftpd/command_handler.rb

Overview

Command handler base class

Constant Summary collapse

COMMAND_FILENAME_PREFIX =
'cmd_'
COMMAND_KLASS_PREFIX =
'Cmd'
COMMAND_METHOD_PREFIX =
'cmd_'

Class Method Summary collapse

Instance Method Summary collapse

Methods included from FileSystemHelper

#ensure_accessible, #ensure_directory, #ensure_does_not_exist, #ensure_exists, #ensure_file_system_supports, #path_list, #unique_path

Methods included from Error

#error, #sequence_error, #syntax_error, #unimplemented_error

Methods included from DataConnectionHelper

#close_data_server_socket_when_done, #data_connection_description, #encrypt_data?, #handle_data_disconnect, #make_tls_connection, #open_active_data_connection, #open_active_tls_data_connection, #open_data_connection, #open_passive_data_connection, #open_passive_tls_data_connection, #receive_file, #send_start_of_data_connection_reply, #transmit_file

Constructor Details

#initialize(session) ⇒ CommandHandler

param session [Session] The session



25
26
27
# File 'lib/ftpd/command_handler.rb', line 25

def initialize(session)
  @session = session
end

Class Method Details

.commandsObject



34
35
36
37
38
# File 'lib/ftpd/command_handler.rb', line 34

def commands
  public_instance_methods.map(&:to_s).grep(/#{COMMAND_METHOD_PREFIX}/).map do |method|
    method.gsub(/^#{COMMAND_METHOD_PREFIX}/, '')
  end
end