Class: Chef::Audit::AuditData

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(node_name, run_id) ⇒ AuditData

Returns a new instance of AuditData


28
29
30
31
32
# File 'lib/chef/audit/control_group_data.rb', line 28

def initialize(node_name, run_id)
  @node_name = node_name
  @run_id = run_id
  @control_groups = []
end

Instance Attribute Details

#control_groupsObject (readonly)

Returns the value of attribute control_groups


25
26
27
# File 'lib/chef/audit/control_group_data.rb', line 25

def control_groups
  @control_groups
end

#end_timeObject

Returns the value of attribute end_time


26
27
28
# File 'lib/chef/audit/control_group_data.rb', line 26

def end_time
  @end_time
end

#node_nameObject (readonly)

Returns the value of attribute node_name


25
26
27
# File 'lib/chef/audit/control_group_data.rb', line 25

def node_name
  @node_name
end

#run_idObject (readonly)

Returns the value of attribute run_id


25
26
27
# File 'lib/chef/audit/control_group_data.rb', line 25

def run_id
  @run_id
end

#start_timeObject

Returns the value of attribute start_time


26
27
28
# File 'lib/chef/audit/control_group_data.rb', line 26

def start_time
  @start_time
end

Instance Method Details

#add_control_group(control_group) ⇒ Object


34
35
36
# File 'lib/chef/audit/control_group_data.rb', line 34

def add_control_group(control_group)
  control_groups << control_group
end

#to_hashObject


38
39
40
41
42
43
44
45
46
# File 'lib/chef/audit/control_group_data.rb', line 38

def to_hash
  {
      :node_name => node_name,
      :run_id => run_id,
      :start_time => start_time,
      :end_time => end_time,
      :control_groups => control_groups.collect { |c| c.to_hash },
  }
end