Class: BeamUp::Providers::SFTP::Config
- Inherits:
-
Object
- Object
- BeamUp::Providers::SFTP::Config
- Defined in:
- lib/beam_up/providers/sftp.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#key ⇒ Object
Returns the value of attribute key.
-
#password ⇒ Object
Returns the value of attribute password.
-
#port ⇒ Object
Returns the value of attribute port.
-
#remote_path ⇒ Object
Returns the value of attribute remote_path.
-
#username ⇒ Object
Returns the value of attribute username.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
9 10 11 |
# File 'lib/beam_up/providers/sftp.rb', line 9 def host @host end |
#key ⇒ Object
Returns the value of attribute key.
9 10 11 |
# File 'lib/beam_up/providers/sftp.rb', line 9 def key @key end |
#password ⇒ Object
Returns the value of attribute password.
9 10 11 |
# File 'lib/beam_up/providers/sftp.rb', line 9 def password @password end |
#port ⇒ Object
Returns the value of attribute port.
9 10 11 |
# File 'lib/beam_up/providers/sftp.rb', line 9 def port @port end |
#remote_path ⇒ Object
Returns the value of attribute remote_path.
9 10 11 |
# File 'lib/beam_up/providers/sftp.rb', line 9 def remote_path @remote_path end |
#username ⇒ Object
Returns the value of attribute username.
9 10 11 |
# File 'lib/beam_up/providers/sftp.rb', line 9 def username @username end |
Class Method Details
.config_keys ⇒ Object
7 |
# File 'lib/beam_up/providers/sftp.rb', line 7 def self.config_keys = %w[host port username password key remote_path] |
Instance Method Details
#validate! ⇒ Object
21 22 23 24 25 26 |
# File 'lib/beam_up/providers/sftp.rb', line 21 def validate! raise ConfigurationError, "Host must be set" unless host raise ConfigurationError, "Username must be set" unless username raise ConfigurationError, "Remote path must be set" unless remote_path raise ConfigurationError, "Password or key must be set" unless password || key end |
#with(options) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/beam_up/providers/sftp.rb', line 11 def with() self.host = [:host] self.port = [:port] || 22 self.username = [:username] self.password = [:password] self.key = [:key] self.remote_path = [:remote_path] self end |