Class: Utils::SshTunnelSpecification
- Defined in:
- lib/utils/ssh_tunnel_specification.rb
Instance Attribute Summary collapse
-
#local_addr ⇒ Object
readonly
Returns the value of attribute local_addr.
-
#local_port ⇒ Object
readonly
Returns the value of attribute local_port.
-
#remote_addr ⇒ Object
readonly
Returns the value of attribute remote_addr.
-
#remote_port ⇒ Object
readonly
Returns the value of attribute remote_port.
Instance Method Summary collapse
-
#initialize(spec_string) ⇒ SshTunnelSpecification
constructor
A new instance of SshTunnelSpecification.
- #to_a ⇒ Object
- #to_s ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(spec_string) ⇒ SshTunnelSpecification
Returns a new instance of SshTunnelSpecification.
3 4 5 |
# File 'lib/utils/ssh_tunnel_specification.rb', line 3 def initialize(spec_string) interpret_spec(spec_string) end |
Instance Attribute Details
#local_addr ⇒ Object (readonly)
Returns the value of attribute local_addr.
7 8 9 |
# File 'lib/utils/ssh_tunnel_specification.rb', line 7 def local_addr @local_addr end |
#local_port ⇒ Object (readonly)
Returns the value of attribute local_port.
9 10 11 |
# File 'lib/utils/ssh_tunnel_specification.rb', line 9 def local_port @local_port end |
#remote_addr ⇒ Object (readonly)
Returns the value of attribute remote_addr.
11 12 13 |
# File 'lib/utils/ssh_tunnel_specification.rb', line 11 def remote_addr @remote_addr end |
#remote_port ⇒ Object (readonly)
Returns the value of attribute remote_port.
13 14 15 |
# File 'lib/utils/ssh_tunnel_specification.rb', line 13 def remote_port @remote_port end |
Instance Method Details
#to_a ⇒ Object
15 16 17 |
# File 'lib/utils/ssh_tunnel_specification.rb', line 15 def to_a [ local_addr, local_port, remote_addr, remote_port ] end |
#to_s ⇒ Object
25 26 27 |
# File 'lib/utils/ssh_tunnel_specification.rb', line 25 def to_s to_a * ':' end |
#valid? ⇒ Boolean
19 20 21 22 23 |
# File 'lib/utils/ssh_tunnel_specification.rb', line 19 def valid? if to_a.all? to_s end end |