Class: XFTP::Session::Base Abstract Private
- Inherits:
-
Object
- Object
- XFTP::Session::Base
- Includes:
- DSL::BlockEvaluator, Helpers::Logging
- Defined in:
- lib/xftp/session/base.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Base class for xftp session adapters
Instance Attribute Summary collapse
- #credentials ⇒ Object readonly private
- #settings ⇒ Object readonly private
- #uri ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(uri, settings = {}) ⇒ Base
constructor
private
Creates a session adapter instance.
-
#start(&callback) ⇒ Object
private
Opens a new connection, evaluates the given block and closes the connection.
Methods included from Helpers::Logging
Methods included from DSL::BlockEvaluator
Constructor Details
#initialize(uri, settings = {}) ⇒ Base
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Creates a session adapter instance
17 18 19 20 21 |
# File 'lib/xftp/session/base.rb', line 17 def initialize(uri, settings = {}) @uri = uri @credentials = settings.delete(:credentials) || {} @settings = settings end |
Instance Attribute Details
#credentials ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
12 13 14 |
# File 'lib/xftp/session/base.rb', line 12 def credentials @credentials end |
#settings ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
12 13 14 |
# File 'lib/xftp/session/base.rb', line 12 def settings @settings end |
#uri ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
12 13 14 |
# File 'lib/xftp/session/base.rb', line 12 def uri @uri end |
Instance Method Details
#start(&callback) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Opens a new connection, evaluates the given block and closes the connection
25 26 27 28 29 30 31 |
# File 'lib/xftp/session/base.rb', line 25 def start(&callback) log 'starting' open evaluate(&callback) close log 'done' end |