Class: Inspec::Resources::NginxConfHttpEntry
- Inherits:
-
Object
- Object
- Inspec::Resources::NginxConfHttpEntry
- Defined in:
- lib/inspec/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) ⇒ NginxConfHttpEntry
constructor
A new instance of NginxConfHttpEntry.
- #locations ⇒ Object
- #method_missing(name) ⇒ Object
- #respond_to_missing?(name, include_all = false) ⇒ Boolean
- #to_s ⇒ Object (also: #inspect)
Constructor Details
#initialize(params, parent) ⇒ NginxConfHttpEntry
Returns a new instance of NginxConfHttpEntry.
175 176 177 178 |
# File 'lib/inspec/resources/nginx_conf.rb', line 175 def initialize(params, parent) @params = params || {} @parent = parent end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name) ⇒ Object
193 194 195 196 197 |
# File 'lib/inspec/resources/nginx_conf.rb', line 193 def method_missing(name) return super if name.to_s.match?(/^to_/) (@params[name.to_s] || []).flatten end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
174 175 176 |
# File 'lib/inspec/resources/nginx_conf.rb', line 174 def params @params end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
174 175 176 |
# File 'lib/inspec/resources/nginx_conf.rb', line 174 def parent @parent end |
Instance Method Details
#locations ⇒ Object
184 185 186 |
# File 'lib/inspec/resources/nginx_conf.rb', line 184 def locations servers.map(&:locations).flatten end |
#respond_to_missing?(name, include_all = false) ⇒ Boolean
199 200 201 202 203 |
# File 'lib/inspec/resources/nginx_conf.rb', line 199 def respond_to_missing?(name, include_all = false) return super if name.to_s.match?(/^to_/) true end |
#to_s ⇒ Object Also known as: inspect
188 189 190 |
# File 'lib/inspec/resources/nginx_conf.rb', line 188 def to_s @parent.to_s + ", http entry" end |