Class: Nginx::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/shared_infrastructure/nginx/server.rb

Overview

The server_name line of a server block.

Direct Known Subclasses

RailsServer, Site, StaticServer

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(domain_name) ⇒ Server

Returns a new instance of Server.



9
10
11
# File 'lib/shared_infrastructure/nginx/server.rb', line 9

def initialize(domain_name)
  @domain_name = domain_name
end

Instance Attribute Details

#domain_nameObject (readonly)

Returns the value of attribute domain_name.



7
8
9
# File 'lib/shared_infrastructure/nginx/server.rb', line 7

def domain_name
  @domain_name
end

Instance Method Details

#to_s(level = 0) ⇒ Object



13
14
15
# File 'lib/shared_infrastructure/nginx/server.rb', line 13

def to_s(level = 0)
  Lines.new("server_name #{Nginx.certbot_domain_names(domain_name)};").format(level)
end