Class: Gitlab::Database::LoadBalancing::ServiceDiscovery::Address

Inherits:
Struct
  • Object
show all
Defined in:
lib/gitlab/database/load_balancing/service_discovery.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#hostnameObject

Returns the value of attribute hostname

Returns:

  • (Object)

    the current value of hostname



34
35
36
# File 'lib/gitlab/database/load_balancing/service_discovery.rb', line 34

def hostname
  @hostname
end

#portObject

Returns the value of attribute port

Returns:

  • (Object)

    the current value of 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_sObject



35
36
37
# File 'lib/gitlab/database/load_balancing/service_discovery.rb', line 35

def to_s
  port ? "#{hostname}:#{port}" : hostname
end