sfml3.rb

Class: SFML::FtpResponse

Inherits:
Object
  • Object
show all
Defined in:
ext/network/ftp.c,
ext/network/ftp.c

Overview

The status and message returned by most Ftp commands.

Instance Method Summary collapse

Instance Method Details

#message ⇒ String

Returns the message sent by the server.

Returns:

  • (String)

Returns:

  • (String) —

    the full response message sent by the server



441
442
443
# File 'ext/network/ftp.c', line 441

static VALUE FtpResponse_message(VALUE self) {
    return rb_str_new_cstr(sfFtpResponse_getMessage(Get_FtpResponse_Struct(self)));
}

#ok? ⇒ Boolean

Returns true if the server reported success.

Returns:

  • (Boolean)

Returns:

  • (Boolean) —

    whether the status is a "success" code (< 400)



410
411
412
# File 'ext/network/ftp.c', line 410

static VALUE FtpResponse_ok(VALUE self) {
    return BOOL2RB(sfFtpResponse_isOk(Get_FtpResponse_Struct(self)));
}

#status ⇒ Integer

Returns the raw status code reported by the server.

Returns:

  • (Integer)

Returns:

  • (Integer) —

    the raw FTP status code



420
421
422
# File 'ext/network/ftp.c', line 420

static VALUE FtpResponse_status(VALUE self) {
    return INT2NUM(sfFtpResponse_getStatus(Get_FtpResponse_Struct(self)));
}

#status_name ⇒ Symbol

Returns the status as an FtpStatus name.

Returns:

  • (Symbol)

Returns:

  • (Symbol) —

    an FtpStatus name for #status



430
431
432
433
# File 'ext/network/ftp.c', line 430

static VALUE FtpResponse_status_name(VALUE self) {
    return ID2SYM(
        rb_intern(ftp_status_name(sfFtpResponse_getStatus(Get_FtpResponse_Struct(self)))));
}