class SFML::Network::Ftp::Response
Generic response: most FTP operations return this.
Public Class Methods
Source
# File lib/sfml/network/ftp.rb, line 159 def self._take_ownership(ptr) obj = allocate obj.instance_variable_set(:@handle, FFI::AutoPointer.new(ptr, C::Network.method(:sfFtpResponse_destroy))) obj end
@!visibility private
Public Instance Methods
Source
# File lib/sfml/network/ftp.rb, line 149 def ok? = C::Network.sfFtpResponse_isOk(@handle) # Returns the status. def status = C::Network.sfFtpResponse_getStatus(@handle) # Returns the status symbol. def status_symbol = STATUS_NAMES[status] || status # Returns the message. def message = C::Network.sfFtpResponse_getMessage(@handle).to_s attr_reader :handle # :nodoc: # @!visibility private def self._take_ownership(ptr) obj = allocate obj.instance_variable_set(:@handle, FFI::AutoPointer.new(ptr, C::Network.method(:sfFtpResponse_destroy))) obj end end # Returned by working_directory and create_directory — adds the # `#directory` accessor on top of Response. class DirectoryResponse # `true` if ok. def ok? = C::Network.sfFtpDirectoryResponse_isOk(@handle) # Returns the status. def status = C::Network.sfFtpDirectoryResponse_getStatus(@handle) # Returns the status symbol. def status_symbol = STATUS_NAMES[status] || status # Returns the message. def message = C::Network.sfFtpDirectoryResponse_getMessage(@handle).to_s # Returns the directory. def directory = C::Network.sfFtpDirectoryResponse_getDirectory(@handle).to_s attr_reader :handle # :nodoc: # @!visibility private def self._take_ownership(ptr) obj = allocate obj.instance_variable_set(:@handle, FFI::AutoPointer.new(ptr, C::Network.method(:sfFtpDirectoryResponse_destroy))) obj end end # Returned by directory_listing — adds the `#names` array. class ListingResponse # `true` if ok. def ok? = C::Network.sfFtpListingResponse_isOk(@handle) # Returns the status. def status = C::Network.sfFtpListingResponse_getStatus(@handle) # Returns the status symbol. def status_symbol = STATUS_NAMES[status] || status # Returns the message. def message = C::Network.sfFtpListingResponse_getMessage(@handle).to_s # Returns the count. def count = C::Network.sfFtpListingResponse_getCount(@handle) attr_reader :handle # :nodoc: # Filenames returned by the listing, as an Array of Strings. def names Array.new(count) { |i| C::Network.sfFtpListingResponse_getName(@handle, i).to_s } end # @!visibility private def self._take_ownership(ptr) obj = allocate obj.instance_variable_set(:@handle, FFI::AutoPointer.new(ptr, C::Network.method(:sfFtpListingResponse_destroy
true if ok.
Source
# File lib/sfml/network/ftp.rb, line 151 def status = C::Network.sfFtpResponse_getStatus(@handle) # Returns the status symbol. def status_symbol = STATUS_NAMES[status] || status # Returns the message. def message = C::Network.sfFtpResponse_getMessage(@handle).to_s attr_reader :handle # :nodoc: # @!visibility private def self._take_ownership(ptr) obj = allocate obj.instance_variable_set(:@handle, FFI::AutoPointer.new(ptr, C::Network.method(:sfFtpResponse_destroy))) obj end end # Returned by working_directory and create_directory — adds the # `#directory` accessor on top of Response. class DirectoryResponse # `true` if ok. def ok? = C::Network.sfFtpDirectoryResponse_isOk(@handle) # Returns the status. def status = C::Network.sfFtpDirectoryResponse_getStatus(@handle) # Returns the status symbol. def status_symbol = STATUS_NAMES[status] || status # Returns the message. def message = C::Network.sfFtpDirectoryResponse_getMessage(@handle).to_s # Returns the directory. def directory = C::Network.sfFtpDirectoryResponse_getDirectory(@handle).to_s attr_reader :handle # :nodoc: # @!visibility private def self._take_ownership(ptr) obj = allocate obj.instance_variable_set(:@handle, FFI::AutoPointer.new(ptr, C::Network.method(:sfFtpDirectoryResponse_destroy))) obj end end # Returned by directory_listing — adds the `#names` array. class ListingResponse # `true` if ok. def ok? = C::Network.sfFtpListingResponse_isOk(@handle) # Returns the status. def status = C::Network.sfFtpListingResponse_getStatus(@handle) # Returns the status symbol. def status_symbol = STATUS_NAMES[status] || status # Returns the message. def message = C::Network.sfFtpListingResponse_getMessage(@handle).to_s # Returns the count. def count = C::Network.sfFtpListingResponse_getCount(@handle) attr_reader :handle # :nodoc: # Filenames returned by the listing, as an Array of Strings. def names Array.new(count) { |i| C::Network.sfFtpListingResponse_getName(@handle, i).to_s } end # @!visibility private def self._take_ownership(ptr) obj = allocate obj.instance_variable_set(:@handle, FFI::AutoPointer.new(ptr, C::Network.method(:sfFtpListingResponse_destroy))
Source
# File lib/sfml/network/ftp.rb, line 153 def status_symbol = STATUS_NAMES[status] || status # Returns the message. def message = C::Network.sfFtpResponse_getMessage(@handle).to_s attr_reader :handle # :nodoc: # @!visibility private def self._take_ownership(ptr) obj = allocate obj.instance_variable_set(:@handle, FFI::AutoPointer.new(ptr, C::Network.method(:sfFtpResponse_destroy))) obj end end # Returned by working_directory and create_directory — adds the # `#directory` accessor on top of Response. class DirectoryResponse # `true` if ok. def ok? = C::Network.sfFtpDirectoryResponse_isOk(@handle) # Returns the status. def status = C::Network.sfFtpDirectoryResponse_getStatus(@handle) # Returns the status symbol. def status_symbol = STATUS_NAMES[status] || status # Returns the message. def message = C::Network.sfFtpDirectoryResponse_getMessage(@handle).to_s # Returns the directory. def directory = C::Network.sfFtpDirectoryResponse_getDirectory(@handle).to_s attr_reader :handle # :nodoc: # @!visibility private def self._take_ownership(ptr) obj = allocate obj.instance_variable_set(:@handle, FFI::AutoPointer.new(ptr, C::Network.method(:sfFtpDirectoryResponse_destroy))) obj end end # Returned by directory_listing — adds the `#names` array. class ListingResponse # `true` if ok. def ok? = C::Network.sfFtpListingResponse_isOk(@handle) # Returns the status. def status = C::Network.sfFtpListingResponse_getStatus(@handle) # Returns the status symbol. def status_symbol = STATUS_NAMES[status] || status # Returns the message. def message = C::Network.sfFtpListingResponse_getMessage(@handle).to_s # Returns the count. def count = C::Network.sfFtpListingResponse_getCount(@handle) attr_reader :handle # :nodoc: # Filenames returned by the listing, as an Array of Strings. def names Array.new(count) { |i| C::Network.sfFtpListingResponse_getName(@handle, i).to_s } end # @!visibility private def self._take_ownership(ptr) obj = allocate obj.instance_variable_set(:@handle, FFI::AutoPointer.new(ptr, C::Network.method(:sfFtpListingResponse_destroy)))