Class: Chef::Audit::ControlData

Inherits:
Object
  • Object
show all
Defined in:
lib/chef/audit/control_group_data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#contextObject (readonly)

Returns the value of attribute context.



116
117
118
# File 'lib/chef/audit/control_group_data.rb', line 116

def context
  @context
end

#detailsObject

Returns the value of attribute details.



117
118
119
# File 'lib/chef/audit/control_group_data.rb', line 117

def details
  @details
end

#line_numberObject (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

#nameObject (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_nameObject (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_typeObject (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

#statusObject

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_hashObject



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