Class: SSHKit::HostWithPortParser
- Inherits:
-
SimpleHostParser
- Object
- SimpleHostParser
- SSHKit::HostWithPortParser
- Defined in:
- lib/sshkit/host.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.suitable?(host_string) ⇒ Boolean
130 131 132 |
# File 'lib/sshkit/host.rb', line 130 def self.suitable?(host_string) !host_string.match /[@|\[|\]]/ end |
Instance Method Details
#hostname ⇒ Object
138 139 140 |
# File 'lib/sshkit/host.rb', line 138 def hostname @host_string.split(':').first end |
#port ⇒ Object
134 135 136 |
# File 'lib/sshkit/host.rb', line 134 def port @host_string.split(':').last.to_i end |