Class: Capistrano::Doctor::ServersDoctor::ServerDecorator

Inherits:
Object
  • Object
show all
Defined in:
lib/capistrano/doctor/servers_doctor.rb

Instance Method Summary collapse

Constructor Details

#initialize(server) ⇒ ServerDecorator

Returns a new instance of ServerDecorator.



65
66
67
# File 'lib/capistrano/doctor/servers_doctor.rb', line 65

def initialize(server)
  @server = server
end

Instance Method Details

#propertiesObject



83
84
85
86
# File 'lib/capistrano/doctor/servers_doctor.rb', line 83

def properties
  return "" unless server.properties.keys.any?
  pretty_inspect(server.properties.to_h)
end

#rolesObject



79
80
81
# File 'lib/capistrano/doctor/servers_doctor.rb', line 79

def roles
  server.roles.to_a.inspect
end

#uri_formObject



69
70
71
72
73
74
75
76
77
# File 'lib/capistrano/doctor/servers_doctor.rb', line 69

def uri_form
  [
    server.user,
    server.user && "@",
    server.hostname,
    server.port && ":",
    server.port
  ].compact.join
end