Class: Nginx::Server
- Inherits:
-
Object
- Object
- Nginx::Server
- Defined in:
- lib/shared_infrastructure/nginx/server.rb
Overview
The server_name line of a server block.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
Instance Method Summary collapse
-
#initialize(domain: nil) ⇒ Server
constructor
A new instance of Server.
- #root_directory ⇒ Object
- #to_s(level = 0) ⇒ Object
Constructor Details
#initialize(domain: nil) ⇒ Server
Returns a new instance of Server.
7 8 9 |
# File 'lib/shared_infrastructure/nginx/server.rb', line 7 def initialize(domain: nil) @domain = domain end |
Instance Attribute Details
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
11 12 13 |
# File 'lib/shared_infrastructure/nginx/server.rb', line 11 def domain @domain end |
Instance Method Details
#root_directory ⇒ Object
13 14 15 |
# File 'lib/shared_infrastructure/nginx/server.rb', line 13 def root_directory domain.site_root end |
#to_s(level = 0) ⇒ Object
17 18 19 |
# File 'lib/shared_infrastructure/nginx/server.rb', line 17 def to_s(level = 0) Lines.new("server_name #{domain.certbot_domain_names};").format(level) end |