Class: FileTransfer::Generic
- Inherits:
-
Object
- Object
- FileTransfer::Generic
- Defined in:
- lib/file_transfer/generic.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#password ⇒ Object
Returns the value of attribute password.
-
#port ⇒ Object
Returns the value of attribute port.
-
#timeout_seconds ⇒ Object
Returns the value of attribute timeout_seconds.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
- #close ⇒ Object
- #download(from_path, to_path) ⇒ Object
- #exist?(file_path) ⇒ Boolean
-
#initialize(options = {}) ⇒ Generic
constructor
A new instance of Generic.
- #list(dir, filter = "") ⇒ Object
- #move(file_name, from_dir, to_dir) ⇒ Object
- #to_s ⇒ Object
- #upload(from_path, to_path) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Generic
Returns a new instance of Generic.
7 8 9 10 11 12 13 |
# File 'lib/file_transfer/generic.rb', line 7 def initialize( = {}) @host = [:host] || "localhost" @username = [:username] || "anonymous" @password = [:password] || "" @port = [:port] || 21 @timeout_seconds = [:timeout] || 300 end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
5 6 7 |
# File 'lib/file_transfer/generic.rb', line 5 def host @host end |
#password ⇒ Object
Returns the value of attribute password.
5 6 7 |
# File 'lib/file_transfer/generic.rb', line 5 def password @password end |
#port ⇒ Object
Returns the value of attribute port.
5 6 7 |
# File 'lib/file_transfer/generic.rb', line 5 def port @port end |
#timeout_seconds ⇒ Object
Returns the value of attribute timeout_seconds.
5 6 7 |
# File 'lib/file_transfer/generic.rb', line 5 def timeout_seconds @timeout_seconds end |
#username ⇒ Object
Returns the value of attribute username.
5 6 7 |
# File 'lib/file_transfer/generic.rb', line 5 def username @username end |
Instance Method Details
#close ⇒ Object
30 31 |
# File 'lib/file_transfer/generic.rb', line 30 def close end |
#download(from_path, to_path) ⇒ Object
21 22 |
# File 'lib/file_transfer/generic.rb', line 21 def download(from_path, to_path) end |
#exist?(file_path) ⇒ Boolean
27 28 |
# File 'lib/file_transfer/generic.rb', line 27 def exist?(file_path) end |
#list(dir, filter = "") ⇒ Object
15 16 |
# File 'lib/file_transfer/generic.rb', line 15 def list(dir, filter="") end |
#move(file_name, from_dir, to_dir) ⇒ Object
24 25 |
# File 'lib/file_transfer/generic.rb', line 24 def move(file_name, from_dir, to_dir) end |
#to_s ⇒ Object
33 34 35 |
# File 'lib/file_transfer/generic.rb', line 33 def to_s "FtpClient {@host => #{host}, @username => #{username}, @protocol => #{type}, @port => #{port}, @password => ***}" end |
#upload(from_path, to_path) ⇒ Object
18 19 |
# File 'lib/file_transfer/generic.rb', line 18 def upload(from_path, to_path) end |