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.
-
#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:) ⇒ Server
constructor
A new instance of Server.
- #semaphore ⇒ Object
- #synchronize(&block) ⇒ Object
Methods included from Concerns::Inspectable
Constructor Details
#initialize(name:, host:, user:, port:) ⇒ Server
Returns a new instance of Server.
6 7 8 9 10 11 |
# File 'lib/indocker/server.rb', line 6 def initialize(name:, host:, user:, port:) @name = name @host = host @user = user @port = port 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 |
#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
13 14 15 16 17 18 19 |
# File 'lib/indocker/server.rb', line 13 def ==(value) if value.is_a?(Indocker::Server) @name == value.name else super end end |
#semaphore ⇒ Object
27 28 29 |
# File 'lib/indocker/server.rb', line 27 def semaphore @semaphore ||= Mutex.new end |
#synchronize(&block) ⇒ Object
21 22 23 24 25 |
# File 'lib/indocker/server.rb', line 21 def synchronize(&block) semaphore.synchronize do block.call if block_given? end end |