Class: EtcHosts

Inherits:
Object
  • Object
show all
Includes:
CommentParser
Defined in:
lib/resources/etc_hosts.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from CommentParser

#parse_comment_line

Constructor Details

#initialize(hosts_path = nil) ⇒ EtcHosts

Returns a new instance of EtcHosts.



22
23
24
25
26
27
28
# File 'lib/resources/etc_hosts.rb', line 22

def initialize(hosts_path = nil)
  return skip_resource 'The `etc_hosts` resource is not supported on your OS.' unless inspec.os.bsd? || inspec.os.linux? || inspec.os.windows?
  @conf_path      = hosts_path || default_hosts_file_path
  @content        = nil
  @params         = nil
  read_content
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



18
19
20
# File 'lib/resources/etc_hosts.rb', line 18

def params
  @params
end