Class: Inspec::Resources::NginxConfLocation
- Inherits:
-
Object
- Object
- Inspec::Resources::NginxConfLocation
- Defined in:
- lib/resources/nginx_conf.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
-
#initialize(params, parent) ⇒ NginxConfLocation
constructor
A new instance of NginxConfLocation.
- #to_s ⇒ Object (also: #inspect)
Constructor Details
#initialize(params, parent) ⇒ NginxConfLocation
Returns a new instance of NginxConfLocation.
189 190 191 192 |
# File 'lib/resources/nginx_conf.rb', line 189 def initialize(params, parent) @parent = parent @params = params || {} end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
188 189 190 |
# File 'lib/resources/nginx_conf.rb', line 188 def params @params end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
188 189 190 |
# File 'lib/resources/nginx_conf.rb', line 188 def parent @parent end |
Instance Method Details
#to_s ⇒ Object Also known as: inspect
194 195 196 197 198 |
# File 'lib/resources/nginx_conf.rb', line 194 def to_s location = Array(params['_']).join(' ') # go three levels up: 1. to the server entry, 2. http entry and 3. to the root nginx conf @parent.parent.parent.to_s + ", location #{location.inspect}" end |