Class: Gitlab::Database::LoadBalancing::ServiceDiscovery::Address
- Inherits:
-
Struct
- Object
- Struct
- Gitlab::Database::LoadBalancing::ServiceDiscovery::Address
- Defined in:
- lib/gitlab/database/load_balancing/service_discovery.rb
Instance Attribute Summary collapse
-
#hostname ⇒ Object
Returns the value of attribute hostname.
-
#port ⇒ Object
Returns the value of attribute port.
Instance Method Summary collapse
Instance Attribute Details
#hostname ⇒ Object
Returns the value of attribute hostname
34 35 36 |
# File 'lib/gitlab/database/load_balancing/service_discovery.rb', line 34 def hostname @hostname end |
#port ⇒ Object
Returns the value of attribute port
34 35 36 |
# File 'lib/gitlab/database/load_balancing/service_discovery.rb', line 34 def port @port end |
Instance Method Details
#<=>(other) ⇒ Object
39 40 41 |
# File 'lib/gitlab/database/load_balancing/service_discovery.rb', line 39 def <=>(other) self.to_s <=> other.to_s end |
#to_s ⇒ Object
35 36 37 |
# File 'lib/gitlab/database/load_balancing/service_discovery.rb', line 35 def to_s port ? "#{hostname}:#{port}" : hostname end |