Class: Nginx::AccelLocation

Inherits:
Location show all
Defined in:
lib/shared_infrastructure/nginx/location.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(domain_name, accel, domain: nil) ⇒ AccelLocation

Returns a new instance of AccelLocation.



21
22
23
24
25
26
# File 'lib/shared_infrastructure/nginx/location.rb', line 21

def initialize(domain_name, accel, domain: nil)
  super(location)
  @domain = domain
  @domain_name = domain_name
  @accel = accel
end

Instance Attribute Details

#accelObject (readonly)

Returns the value of attribute accel.



35
36
37
# File 'lib/shared_infrastructure/nginx/location.rb', line 35

def accel
  @accel
end

#domainObject (readonly)

Returns the value of attribute domain.



35
36
37
# File 'lib/shared_infrastructure/nginx/location.rb', line 35

def domain
  @domain
end

#domain_nameObject (readonly)

Returns the value of attribute domain_name.



35
36
37
# File 'lib/shared_infrastructure/nginx/location.rb', line 35

def domain_name
  @domain_name
end

Instance Method Details

#to_s(level = 0) ⇒ Object



28
29
30
31
32
33
# File 'lib/shared_infrastructure/nginx/location.rb', line 28

def to_s(level = 0)
  Lines.new("location #{accel.location} {",
    "  internal;",
    "  alias #{accel.alias_string};",
    "}").format(level)
end