Class: Inspec::Resources::MssqlSysConf

Inherits:
Object
  • Object
show all
Defined in:
lib/inspec/resources/mssql_sys_conf.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(conf_param_name, opts = {}) ⇒ MssqlSysConf

Returns a new instance of MssqlSysConf.



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

def initialize(conf_param_name, opts = {})
  opts[:username] ||= "SA"
  @mssql_session = inspec.mssql_session(opts)
  setting = conf_param_name.to_s.gsub("_", " ").split.map(&:capitalize).join(" ")
  determine_system_configurations(setting)
end

Instance Attribute Details

#mssql_sessionObject (readonly)

Returns the value of attribute mssql_session.



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

def mssql_session
  @mssql_session
end

#sql_queryObject (readonly)

Returns the value of attribute sql_query.



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

def sql_query
  @sql_query
end

Instance Method Details

#to_sObject



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

def to_s
  "MsSql DB Configuration"
end

#value_configuredObject



32
33
34
# File 'lib/inspec/resources/mssql_sys_conf.rb', line 32

def value_configured
  sql_query.row(0).column("value_configured").value
end

#value_in_useObject



28
29
30
# File 'lib/inspec/resources/mssql_sys_conf.rb', line 28

def value_in_use
  sql_query.row(0).column("value_in_use").value
end