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.



139
140
141
142
# File 'lib/inspec/resources/nginx_conf.rb', line 139

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.



138
139
140
# File 'lib/inspec/resources/nginx_conf.rb', line 138

def entries
  @entries
end

Instance Method Details

#locationsObject



148
149
150
# File 'lib/inspec/resources/nginx_conf.rb', line 148

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

#serversObject



144
145
146
# File 'lib/inspec/resources/nginx_conf.rb', line 144

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

#to_sObject Also known as: inspect



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

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