Class: Nginx::Upstream

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(domain_name) ⇒ Upstream

Returns a new instance of Upstream.



5
6
7
# File 'lib/shared_infrastructure/nginx/upstream.rb', line 5

def initialize(domain_name)
  @domain_name = domain_name
end

Instance Attribute Details

#domain_nameObject (readonly)

Returns the value of attribute domain_name.



17
18
19
# File 'lib/shared_infrastructure/nginx/upstream.rb', line 17

def domain_name
  @domain_name
end

Instance Method Details

#to_s(level = 0) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/shared_infrastructure/nginx/upstream.rb', line 9

def to_s(level = 0)
  Lines.new(
    "upstream #{domain_name} {",
    Lines.indent("server unix:///tmp/#{domain_name}.sock fail_timeout=0;", 1),
    "}"
  ).format(level)
end