Class: ProxiedFtp
- Inherits:
-
Net::FTP
- Object
- Net::FTP
- ProxiedFtp
- Defined in:
- lib/proxied_ftp.rb
Instance Attribute Summary collapse
-
#p_host ⇒ Object
readonly
Returns the value of attribute p_host.
-
#p_port ⇒ Object
readonly
Returns the value of attribute p_port.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(p_host, p_port, host = nil, user = nil, passwd = nil, acct = nil) ⇒ ProxiedFtp
constructor
A new instance of ProxiedFtp.
Constructor Details
#initialize(p_host, p_port, host = nil, user = nil, passwd = nil, acct = nil) ⇒ ProxiedFtp
Returns a new instance of ProxiedFtp.
20 21 22 23 24 |
# File 'lib/proxied_ftp.rb', line 20 def initialize(p_host, p_port, host = nil, user = nil, passwd = nil, acct = nil) @p_host = p_host @p_port = p_port super(host, user, passwd, acct) end |
Instance Attribute Details
#p_host ⇒ Object (readonly)
Returns the value of attribute p_host.
5 6 7 |
# File 'lib/proxied_ftp.rb', line 5 def p_host @p_host end |
#p_port ⇒ Object (readonly)
Returns the value of attribute p_port.
5 6 7 |
# File 'lib/proxied_ftp.rb', line 5 def p_port @p_port end |
Class Method Details
.open(p_host, p_port, host, user = nil, passwd = nil, acct = nil) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/proxied_ftp.rb', line 7 def self.open(p_host, p_port, host, user = nil, passwd = nil, acct = nil) if block_given? ftp = new(p_host, p_port, host, user, passwd, acct) begin yield ftp ensure ftp.close end else new(p_host, p_port, host, user, passwd, acct) end end |