Class: Inspec::Resources::EtcHostsAllow

Inherits:
Object
  • Object
show all
Includes:
FileReader, Utils::CommentParser
Defined in:
lib/inspec/resources/etc_hosts_allow_deny.rb

Direct Known Subclasses

EtcHostsDeny

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from FileReader

#read_file_content

Methods included from Utils::CommentParser

#parse_comment_line

Constructor Details

#initialize(hosts_allow_path = nil) ⇒ EtcHostsAllow

Returns a new instance of EtcHostsAllow.



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

def initialize(hosts_allow_path = nil)
  @conf_path      = hosts_allow_path || "/etc/hosts.allow"
  @content        = nil
  @params         = nil
  read_content
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



17
18
19
# File 'lib/inspec/resources/etc_hosts_allow_deny.rb', line 17

def params
  @params
end

Instance Method Details

#to_sObject



36
37
38
# File 'lib/inspec/resources/etc_hosts_allow_deny.rb', line 36

def to_s
  "hosts.allow Configuration"
end