Skip to content

class SF::Ftp::Response
inherits Reference #

Define a FTP response

Direct known subclasses

SF::Ftp::DirectoryResponse SF::Ftp::ListingResponse

Class methods#

.new(code : Ftp::Response::Status = InvalidResponse, message : String = "") #

Default constructor

This constructor is used by the FTP client to build the response.

  • code - Response status code
  • message - Response message
View source

Methods#

#dup : Response #

Returns a shallow copy of this object.

This allocates a new object and copies the contents of self into it.

View source

#finalize #

View source

#message : String #

Get the full message contained in the response

Returns: The response message

View source

#ok? : Bool #

Check if the status code means a success

This function is defined for convenience, it is equivalent to testing if the status code is < 400.

Returns: True if the status is a success, false if it is a failure

View source

#status : Ftp::Response::Status #

Get the status code of the response

Returns: Status code

View source