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.



154
155
156
157
# File 'lib/inspec/resources/nginx_conf.rb', line 154

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.



153
154
155
# File 'lib/inspec/resources/nginx_conf.rb', line 153

def entries
  @entries
end

Instance Method Details

#locationsObject



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

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

#serversObject



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

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

#to_sObject Also known as: inspect



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

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