Class: Chef::Audit::AuditData
- Inherits:
-
Object
- Object
- Chef::Audit::AuditData
- Defined in:
- lib/chef/audit/control_group_data.rb
Instance Attribute Summary collapse
-
#control_groups ⇒ Object
readonly
Returns the value of attribute control_groups.
-
#end_time ⇒ Object
Returns the value of attribute end_time.
-
#node_name ⇒ Object
readonly
Returns the value of attribute node_name.
-
#run_id ⇒ Object
readonly
Returns the value of attribute run_id.
-
#start_time ⇒ Object
Returns the value of attribute start_time.
Instance Method Summary collapse
- #add_control_group(control_group) ⇒ Object
-
#initialize(node_name, run_id) ⇒ AuditData
constructor
A new instance of AuditData.
- #to_hash ⇒ Object
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_groups ⇒ Object (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_time ⇒ Object
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_name ⇒ Object (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_id ⇒ Object (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_time ⇒ Object
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_hash ⇒ Object
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 |