Class: Inspec::Resources::SybaseConf
- Inherits:
-
Object
- Object
- Inspec::Resources::SybaseConf
- Defined in:
- lib/inspec/resources/sybase_conf.rb
Instance Attribute Summary collapse
-
#conf_param ⇒ Object
readonly
Returns the value of attribute conf_param.
-
#sql_query ⇒ Object
readonly
Returns the value of attribute sql_query.
Instance Method Summary collapse
- #config_value ⇒ Object
-
#initialize(conf_param_name, opts = {}) ⇒ SybaseConf
constructor
A new instance of SybaseConf.
- #resource_id ⇒ Object
- #run_value ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(conf_param_name, opts = {}) ⇒ SybaseConf
Returns a new instance of SybaseConf.
16 17 18 19 20 21 22 |
# File 'lib/inspec/resources/sybase_conf.rb', line 16 def initialize(conf_param_name, opts = {}) @conf_param = conf_param_name opts[:username] ||= "sa" opts[:database] ||= "master" sql_session = inspec.sybase_session(opts) @sql_query = sql_session.query("sp_configure \"#{conf_param}\"") end |
Instance Attribute Details
#conf_param ⇒ Object (readonly)
Returns the value of attribute conf_param.
15 16 17 |
# File 'lib/inspec/resources/sybase_conf.rb', line 15 def conf_param @conf_param end |
#sql_query ⇒ Object (readonly)
Returns the value of attribute sql_query.
15 16 17 |
# File 'lib/inspec/resources/sybase_conf.rb', line 15 def sql_query @sql_query end |
Instance Method Details
#config_value ⇒ Object
28 29 30 |
# File 'lib/inspec/resources/sybase_conf.rb', line 28 def config_value sql_query.row(0).column("Config Value").value end |
#resource_id ⇒ Object
32 33 34 |
# File 'lib/inspec/resources/sybase_conf.rb', line 32 def resource_id conf_param || "Sybase config settings" end |
#run_value ⇒ Object
24 25 26 |
# File 'lib/inspec/resources/sybase_conf.rb', line 24 def run_value sql_query.row(0).column("Run Value").value end |
#to_s ⇒ Object
36 37 38 |
# File 'lib/inspec/resources/sybase_conf.rb', line 36 def to_s "Sybase Conf #{conf_param}" end |