Class: Fog::SCP::Mock
- Inherits:
-
Object
- Object
- Fog::SCP::Mock
- Defined in:
- lib/fog/core/scp.rb
Class Method Summary collapse
Instance Method Summary collapse
- #download(remote_path, local_path, download_options = {}) ⇒ Object
-
#initialize(address, username, options) ⇒ Mock
constructor
A new instance of Mock.
- #upload(local_path, remote_path, upload_options = {}) ⇒ Object
Constructor Details
#initialize(address, username, options) ⇒ Mock
Returns a new instance of Mock.
18 19 20 21 22 |
# File 'lib/fog/core/scp.rb', line 18 def initialize(address, username, ) @address = address @username = username @options = end |
Class Method Details
.data ⇒ Object
12 13 14 15 16 |
# File 'lib/fog/core/scp.rb', line 12 def self.data @data ||= Hash.new do |hash, key| hash[key] = [] end end |
Instance Method Details
#download(remote_path, local_path, download_options = {}) ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/fog/core/scp.rb', line 32 def download(remote_path, local_path, = {}) self.class.data[@address] << { :username => @username, :options => @options, :remote_path => remote_path, :local_path => local_path, :download_options => } end |
#upload(local_path, remote_path, upload_options = {}) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/fog/core/scp.rb', line 24 def upload(local_path, remote_path, = {}) self.class.data[@address] << { :username => @username, :options => @options, :local_path => local_path, :remote_path => remote_path, :upload_options => } end |