Class: Chef::Audit::ControlData
- Inherits:
-
Object
- Object
- Chef::Audit::ControlData
- Defined in:
- lib/chef/audit/control_group_data.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#details ⇒ Object
Returns the value of attribute details.
-
#line_number ⇒ Object
readonly
Returns the value of attribute line_number.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#resource_name ⇒ Object
readonly
Returns the value of attribute resource_name.
-
#resource_type ⇒ Object
readonly
Returns the value of attribute resource_type.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(control_data = {}) ⇒ ControlData
constructor
A new instance of ControlData.
- #to_hash ⇒ Object
Constructor Details
#initialize(control_data = {}) ⇒ ControlData
Returns a new instance of ControlData.
120 121 122 123 124 |
# File 'lib/chef/audit/control_group_data.rb', line 120 def initialize(control_data={}) control_data.each do |k, v| self.instance_variable_set("@#{k}", v) end end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
117 118 119 |
# File 'lib/chef/audit/control_group_data.rb', line 117 def context @context end |
#details ⇒ Object
Returns the value of attribute details.
118 119 120 |
# File 'lib/chef/audit/control_group_data.rb', line 118 def details @details end |
#line_number ⇒ Object (readonly)
Returns the value of attribute line_number.
117 118 119 |
# File 'lib/chef/audit/control_group_data.rb', line 117 def line_number @line_number end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
117 118 119 |
# File 'lib/chef/audit/control_group_data.rb', line 117 def name @name end |
#resource_name ⇒ Object (readonly)
Returns the value of attribute resource_name.
117 118 119 |
# File 'lib/chef/audit/control_group_data.rb', line 117 def resource_name @resource_name end |
#resource_type ⇒ Object (readonly)
Returns the value of attribute resource_type.
117 118 119 |
# File 'lib/chef/audit/control_group_data.rb', line 117 def resource_type @resource_type end |
#status ⇒ Object
Returns the value of attribute status.
118 119 120 |
# File 'lib/chef/audit/control_group_data.rb', line 118 def status @status end |
Instance Method Details
#to_hash ⇒ Object
126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/chef/audit/control_group_data.rb', line 126 def to_hash h = { :name => name, :status => status, :details => details, :resource_type => resource_type, :resource_name => resource_name } h[:context] = context || [] h end |