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.



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

#contextObject (readonly)

Returns the value of attribute context.



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

def context
  @context
end

#detailsObject

Returns the value of attribute details.



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

def details
  @details
end

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

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

#statusObject

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_hashObject



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