Class: Inspec::RunData::Control
- Inherits:
-
Struct
- Object
- Struct
- Inspec::RunData::Control
- Includes:
- HashLikeStruct
- Defined in:
- lib/inspec/run_data/control.rb,
lib/inspec/run_data/control.rb
Defined Under Namespace
Classes: Ref, SourceLocation, WaiverData
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#desc ⇒ Object
Returns the value of attribute desc.
-
#descriptions ⇒ Object
Returns the value of attribute descriptions.
-
#id ⇒ Object
Returns the value of attribute id.
-
#impact ⇒ Object
Returns the value of attribute impact.
-
#refs ⇒ Object
Returns the value of attribute refs.
-
#results ⇒ Object
Returns the value of attribute results.
-
#source_location ⇒ Object
Returns the value of attribute source_location.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#title ⇒ Object
Returns the value of attribute title.
-
#waiver_data ⇒ Object
Returns the value of attribute waiver_data.
Instance Method Summary collapse
-
#initialize(raw_ctl_data) ⇒ Control
constructor
A new instance of Control.
Methods included from HashLikeStruct
Constructor Details
#initialize(raw_ctl_data) ⇒ Control
Returns a new instance of Control.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/inspec/run_data/control.rb', line 17 def initialize(raw_ctl_data) self.refs = (raw_ctl_data[:refs] || []).map { |r| Inspec::RunData::Control::Ref.new(r) } self.results = (raw_ctl_data[:results] || []).map { |r| Inspec::RunData::Result.new(r) } self.source_location = Inspec::RunData::Control::SourceLocation.new(raw_ctl_data[:source_location] || {}) self.waiver_data = Inspec::RunData::Control::WaiverData.new(raw_ctl_data[:waiver_data] || {}) [ :code, # String :desc, # String :descriptions, # Hash with custom keys :id, # String :impact, # Float :tags, # Hash with custom keys :title, # String ].each do |field| self[field] = raw_ctl_data[field] end end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code
3 4 5 |
# File 'lib/inspec/run_data/control.rb', line 3 def code @code end |
#desc ⇒ Object
Returns the value of attribute desc
3 4 5 |
# File 'lib/inspec/run_data/control.rb', line 3 def desc @desc end |
#descriptions ⇒ Object
Returns the value of attribute descriptions
3 4 5 |
# File 'lib/inspec/run_data/control.rb', line 3 def descriptions @descriptions end |
#id ⇒ Object
Returns the value of attribute id
3 4 5 |
# File 'lib/inspec/run_data/control.rb', line 3 def id @id end |
#impact ⇒ Object
Returns the value of attribute impact
3 4 5 |
# File 'lib/inspec/run_data/control.rb', line 3 def impact @impact end |
#refs ⇒ Object
Returns the value of attribute refs
3 4 5 |
# File 'lib/inspec/run_data/control.rb', line 3 def refs @refs end |
#results ⇒ Object
Returns the value of attribute results
3 4 5 |
# File 'lib/inspec/run_data/control.rb', line 3 def results @results end |
#source_location ⇒ Object
Returns the value of attribute source_location
3 4 5 |
# File 'lib/inspec/run_data/control.rb', line 3 def source_location @source_location end |
#tags ⇒ Object
Returns the value of attribute tags
3 4 5 |
# File 'lib/inspec/run_data/control.rb', line 3 def @tags end |
#title ⇒ Object
Returns the value of attribute title
3 4 5 |
# File 'lib/inspec/run_data/control.rb', line 3 def title @title end |
#waiver_data ⇒ Object
Returns the value of attribute waiver_data
3 4 5 |
# File 'lib/inspec/run_data/control.rb', line 3 def waiver_data @waiver_data end |