Class: Inspec::Resources::PostgresHbaConf

Inherits:
Object
  • Object
show all
Includes:
FileReader
Defined in:
lib/inspec/resources/postgres_hba_conf.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from FileReader

#read_file_content

Constructor Details

#initialize(hba_conf_path = nil) ⇒ PostgresHbaConf

TODO:

add checks to ensure that we have data in our file

Returns a new instance of PostgresHbaConf.



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

def initialize(hba_conf_path = nil)
  @conf_file = hba_conf_path || File.join(inspec.postgres.conf_dir, "pg_hba.conf")
  @content = ""
  @params = {}
  read_content
end

Instance Attribute Details

#conf_fileObject (readonly)

Returns the value of attribute conf_file.



19
20
21
# File 'lib/inspec/resources/postgres_hba_conf.rb', line 19

def conf_file
  @conf_file
end

#paramsObject (readonly)

Returns the value of attribute params.



19
20
21
# File 'lib/inspec/resources/postgres_hba_conf.rb', line 19

def params
  @params
end

Instance Method Details

#to_sObject



39
40
41
# File 'lib/inspec/resources/postgres_hba_conf.rb', line 39

def to_s
  "Postgres Hba Config #{@conf_file}"
end