Class: Indocker::Server
- Inherits:
-
Object
- Object
- Indocker::Server
- Includes:
- Concerns::Inspectable
- Defined in:
- lib/indocker/server.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#jump_host ⇒ Object
readonly
Returns the value of attribute jump_host.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
- #==(value) ⇒ Object
-
#initialize(name:, host:, user:, port:, jump_host: nil) ⇒ Server
constructor
jump_host ("user@host") makes every connection to this server tunnel through another one.
- #semaphore ⇒ Object
- #synchronize(&block) ⇒ Object
Methods included from Concerns::Inspectable
Constructor Details
#initialize(name:, host:, user:, port:, jump_host: nil) ⇒ Server
jump_host ("user@host") makes every connection to this server tunnel through another one. Servers whose public address is unreachable can still be deployed to over their internal address that way.
9 10 11 12 13 14 15 |
# File 'lib/indocker/server.rb', line 9 def initialize(name:, host:, user:, port:, jump_host: nil) @name = name @host = host @user = user @port = port @jump_host = jump_host end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
4 5 6 |
# File 'lib/indocker/server.rb', line 4 def host @host end |
#jump_host ⇒ Object (readonly)
Returns the value of attribute jump_host.
4 5 6 |
# File 'lib/indocker/server.rb', line 4 def jump_host @jump_host end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/indocker/server.rb', line 4 def name @name end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
4 5 6 |
# File 'lib/indocker/server.rb', line 4 def port @port end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
4 5 6 |
# File 'lib/indocker/server.rb', line 4 def user @user end |
Instance Method Details
#==(value) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/indocker/server.rb', line 17 def ==(value) if value.is_a?(Indocker::Server) @name == value.name else super end end |
#semaphore ⇒ Object
31 32 33 |
# File 'lib/indocker/server.rb', line 31 def semaphore @semaphore ||= Mutex.new end |
#synchronize(&block) ⇒ Object
25 26 27 28 29 |
# File 'lib/indocker/server.rb', line 25 def synchronize(&block) semaphore.synchronize do block.call if block_given? end end |