Class: Inspec::Resources::MssqlSysConf
- Inherits:
-
Object
- Object
- Inspec::Resources::MssqlSysConf
- Defined in:
- lib/inspec/resources/mssql_sys_conf.rb
Instance Attribute Summary collapse
-
#mssql_session ⇒ Object
readonly
Returns the value of attribute mssql_session.
-
#sql_query ⇒ Object
readonly
Returns the value of attribute sql_query.
Instance Method Summary collapse
-
#initialize(conf_param_name, opts = {}) ⇒ MssqlSysConf
constructor
A new instance of MssqlSysConf.
- #resource_id ⇒ Object
- #to_s ⇒ Object
- #value_configured ⇒ Object
- #value_in_use ⇒ Object
Constructor Details
#initialize(conf_param_name, opts = {}) ⇒ MssqlSysConf
Returns a new instance of MssqlSysConf.
21 22 23 24 25 26 27 28 |
# File 'lib/inspec/resources/mssql_sys_conf.rb', line 21 def initialize(conf_param_name, opts = {}) @conf_param_name = conf_param_name @opts = 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_session ⇒ Object (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_query ⇒ Object (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
#resource_id ⇒ Object
42 43 44 45 |
# File 'lib/inspec/resources/mssql_sys_conf.rb', line 42 def resource_id username = @opts[:username] || "SA" "#{@conf_param_name}-#{username}" end |
#to_s ⇒ Object
38 39 40 |
# File 'lib/inspec/resources/mssql_sys_conf.rb', line 38 def to_s "MsSql DB Configuration" end |
#value_configured ⇒ Object
34 35 36 |
# File 'lib/inspec/resources/mssql_sys_conf.rb', line 34 def value_configured sql_query.row(0).column("value_configured").value end |
#value_in_use ⇒ Object
30 31 32 |
# File 'lib/inspec/resources/mssql_sys_conf.rb', line 30 def value_in_use sql_query.row(0).column("value_in_use").value end |