Class: Inspec::Resources::NginxConfHttp
- Inherits:
-
Object
- Object
- Inspec::Resources::NginxConfHttp
- Defined in:
- lib/resources/nginx_conf.rb
Instance Attribute Summary collapse
-
#entries ⇒ Object
readonly
Returns the value of attribute entries.
Instance Method Summary collapse
-
#initialize(params, parent) ⇒ NginxConfHttp
constructor
A new instance of NginxConfHttp.
- #locations ⇒ Object
- #servers ⇒ Object
- #to_s ⇒ Object (also: #inspect)
Constructor Details
#initialize(params, parent) ⇒ NginxConfHttp
Returns a new instance of NginxConfHttp.
107 108 109 110 |
# File 'lib/resources/nginx_conf.rb', line 107 def initialize(params, parent) @parent = parent @entries = (params || []).map { |x| NginxConfHttpEntry.new(x, parent) } end |
Instance Attribute Details
#entries ⇒ Object (readonly)
Returns the value of attribute entries.
106 107 108 |
# File 'lib/resources/nginx_conf.rb', line 106 def entries @entries end |
Instance Method Details
#locations ⇒ Object
116 117 118 |
# File 'lib/resources/nginx_conf.rb', line 116 def locations servers.map(&:locations).flatten end |
#servers ⇒ Object
112 113 114 |
# File 'lib/resources/nginx_conf.rb', line 112 def servers @entries.map(&:servers).flatten end |
#to_s ⇒ Object Also known as: inspect
120 121 122 |
# File 'lib/resources/nginx_conf.rb', line 120 def to_s @parent.to_s + ', http entries' end |