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.
-
#keys ⇒ Object
Returns the value of attribute keys.
-
#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 14 |
# File 'lib/file_transfer/generic.rb', line 7 def initialize( = {}) @host = [:host] || 'localhost' @username = [:username] || 'anonymous' @password = [:password] || '' @keys = [:keys].to_s.split(',') || [] @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 |
#keys ⇒ Object
Returns the value of attribute keys.
5 6 7 |
# File 'lib/file_transfer/generic.rb', line 5 def keys @keys 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
31 32 |
# File 'lib/file_transfer/generic.rb', line 31 def close end |
#download(from_path, to_path) ⇒ Object
22 23 |
# File 'lib/file_transfer/generic.rb', line 22 def download(from_path, to_path) end |
#exist?(file_path) ⇒ Boolean
28 29 |
# File 'lib/file_transfer/generic.rb', line 28 def exist?(file_path) end |
#list(dir, filter = '') ⇒ Object
16 17 |
# File 'lib/file_transfer/generic.rb', line 16 def list(dir, filter = '') end |
#move(file_name, from_dir, to_dir) ⇒ Object
25 26 |
# File 'lib/file_transfer/generic.rb', line 25 def move(file_name, from_dir, to_dir) end |
#to_s ⇒ Object
34 35 36 |
# File 'lib/file_transfer/generic.rb', line 34 def to_s "FtpClient {@host => #{host}, @username => #{username}, @protocol => #{type}, @port => #{port}, @password => ***}" end |
#upload(from_path, to_path) ⇒ Object
19 20 |
# File 'lib/file_transfer/generic.rb', line 19 def upload(from_path, to_path) end |