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.
119 120 121 122 123 |
# File 'lib/chef/audit/control_group_data.rb', line 119 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.
116 117 118 |
# File 'lib/chef/audit/control_group_data.rb', line 116 def context @context end |
#details ⇒ Object
Returns the value of attribute details.
117 118 119 |
# File 'lib/chef/audit/control_group_data.rb', line 117 def details @details end |
#line_number ⇒ Object (readonly)
Returns the value of attribute line_number.
116 117 118 |
# File 'lib/chef/audit/control_group_data.rb', line 116 def line_number @line_number end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
116 117 118 |
# File 'lib/chef/audit/control_group_data.rb', line 116 def name @name end |
#resource_name ⇒ Object (readonly)
Returns the value of attribute resource_name.
116 117 118 |
# File 'lib/chef/audit/control_group_data.rb', line 116 def resource_name @resource_name end |
#resource_type ⇒ Object (readonly)
Returns the value of attribute resource_type.
116 117 118 |
# File 'lib/chef/audit/control_group_data.rb', line 116 def resource_type @resource_type end |
#status ⇒ Object
Returns the value of attribute status.
117 118 119 |
# File 'lib/chef/audit/control_group_data.rb', line 117 def status @status end |
Instance Method Details
#to_hash ⇒ Object
125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/chef/audit/control_group_data.rb', line 125 def to_hash h = { :name => name, :status => status, :details => details, :resource_type => resource_type, :resource_name => resource_name, } h[:context] = context || [] h end |