Class: Inspec::Resources::NginxConfHttp

Inherits:
Object
  • Object
show all
Defined in:
lib/inspec/resources/nginx_conf.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params, parent) ⇒ NginxConfHttp

Returns a new instance of NginxConfHttp.



158
159
160
161
# File 'lib/inspec/resources/nginx_conf.rb', line 158

def initialize(params, parent)
  @parent = parent
  @entries = (params || []).map { |x| NginxConfHttpEntry.new(x, parent) }
end

Instance Attribute Details

#entriesObject (readonly)

Returns the value of attribute entries.



157
158
159
# File 'lib/inspec/resources/nginx_conf.rb', line 157

def entries
  @entries
end

Instance Method Details

#locationsObject



167
168
169
# File 'lib/inspec/resources/nginx_conf.rb', line 167

def locations
  servers.map(&:locations).flatten
end

#serversObject



163
164
165
# File 'lib/inspec/resources/nginx_conf.rb', line 163

def servers
  @entries.map(&:servers).flatten
end

#to_sObject Also known as: inspect



171
172
173
# File 'lib/inspec/resources/nginx_conf.rb', line 171

def to_s
  @parent.to_s + ", http entries"
end