Class URI::FTP
In: lib/open-uri.rb
lib/uri/ftp.rb
Parent: Object

RFC1738 section 3.2.

Methods

build   new   new2   set_typecode   to_s   typecode=  

Included Modules

OpenURI::OpenRead

Constants

DEFAULT_PORT = 21
COMPONENT = [ :scheme, :userinfo, :host, :port, :path, :typecode
TYPECODE = ['a', 'i', 'd'].freeze   Typecode is, "a", "i" or "d". As for "a" the text, as for "i" binary, as for "d" the directory is displayed. "A" with the text, as for "i" being binary, is because the respective data type was called ASCII and IMAGE with the protocol of FTP.
TYPECODE_PREFIX = ';type='.freeze

Attributes

typecode  [R] 

Public Class methods

Description

Creates a new URI::FTP object from components of URI::FTP with check. It is scheme, userinfo, host, port, path and typecode. It provided by an Array or a Hash. typecode is "a", "i" or "d".

Description

Create a new URI::FTP object from ``generic’’ components with no check.

Usage

  require 'uri'
  p ftp = URI.parse("ftp://ftp.ruby-lang.org/pub/ruby/;type=d")
  # => #<URI::FTP:0x201fad08 URL:ftp://ftp.ruby-lang.org/pub/ruby/;type=d>
  p ftp.typecode
  # => "d"

Public Instance methods

Protected Instance methods

[Validate]

ruby-doc.org is a service of James Britt and Neurogami, a Ruby application development company in Phoenix, AZ.

Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.

For more information on the Ruby programming language, visit ruby-lang.org.

Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.