Fixed review comments: Added attr_accessor for required parameters and removed pass to accept nil

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
This commit is contained in:
Vasu1105 2021-06-30 13:10:46 +05:30
parent 964a5142f7
commit 180ebf0590
2 changed files with 4 additions and 2 deletions

View file

@ -22,6 +22,8 @@ module Inspec::Resources
include FileReader
include ObjectTraverser
attr_accessor :conf_path
def initialize(conf_path = nil)
@conf_path = conf_path || inspec.postgres.conf_path
if @conf_path.nil?

View file

@ -12,7 +12,7 @@ module Inspec::Resources
end
def lines
output.split("\n")
output.split("\n").map(&:strip)
end
def to_s
@ -40,7 +40,7 @@ module Inspec::Resources
end
EXAMPLE
def initialize(user, pass = nil, host = nil, port = nil)
def initialize(user, pass, host = nil, port = nil)
@user = user || "postgres"
@pass = pass
@host = host || "localhost"