Class: Inspec::RunData
- Inherits:
-
Struct
- Object
- Struct
- Inspec::RunData
- Includes:
- HashLikeStruct
- Defined in:
- lib/inspec/run_data.rb,
lib/inspec/run_data.rb,
lib/inspec/run_data/result.rb,
lib/inspec/run_data/control.rb,
lib/inspec/run_data/profile.rb,
lib/inspec/run_data/statistics.rb
Defined Under Namespace
Classes: Control, Platform, Profile, Result, Statistics
Constant Summary collapse
- SCHEMA_VERSION =
This is the data layout version of RunData. We plan to follow a data-oriented version of semver:
patch: fixing a bug in the provenance or description of a data element, no key changes minor: adding new data elements major: deleting or renaming data elements
Less than major version 1.0.0, the API is considered unstable. The current plan is to bump the major version to 1.0.0 when all of the existing core reporters have been migrated to plugins. It is probable that new data elements and new Hash compatibility behavior will be added during the core reporter plugin conversion process.
"0.3.0".freeze
Instance Attribute Summary collapse
-
#controls ⇒ Object
Returns the value of attribute controls.
-
#other_checks ⇒ Object
Returns the value of attribute other_checks.
-
#platform ⇒ Object
Returns the value of attribute platform.
-
#profiles ⇒ Object
Returns the value of attribute profiles.
-
#statistics ⇒ Object
Returns the value of attribute statistics.
-
#version ⇒ Object
Returns the value of attribute version.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(raw_run_data) ⇒ RunData
constructor
A new instance of RunData.
Methods included from HashLikeStruct
Constructor Details
#initialize(raw_run_data) ⇒ RunData
Returns a new instance of RunData.
29 30 31 32 33 34 35 36 37 |
# File 'lib/inspec/run_data.rb', line 29 def initialize(raw_run_data) @raw_run_data = raw_run_data self.controls = @raw_run_data[:controls].map { |c| Inspec::RunData::Control.new(c) } self.profiles = @raw_run_data[:profiles].map { |p| Inspec::RunData::Profile.new(p) } self.statistics = Inspec::RunData::Statistics.new(@raw_run_data[:statistics]) self.platform = Inspec::RunData::Platform.new(@raw_run_data[:platform]) self.version = @raw_run_data[:version] end |
Instance Attribute Details
#controls ⇒ Object
Returns the value of attribute controls
20 21 22 |
# File 'lib/inspec/run_data.rb', line 20 def controls @controls end |
#other_checks ⇒ Object
Returns the value of attribute other_checks
20 21 22 |
# File 'lib/inspec/run_data.rb', line 20 def other_checks @other_checks end |
#platform ⇒ Object
Returns the value of attribute platform
20 21 22 |
# File 'lib/inspec/run_data.rb', line 20 def platform @platform end |
#profiles ⇒ Object
Returns the value of attribute profiles
20 21 22 |
# File 'lib/inspec/run_data.rb', line 20 def profiles @profiles end |
#statistics ⇒ Object
Returns the value of attribute statistics
20 21 22 |
# File 'lib/inspec/run_data.rb', line 20 def statistics @statistics end |
#version ⇒ Object
Returns the value of attribute version
20 21 22 |
# File 'lib/inspec/run_data.rb', line 20 def version @version end |
Class Method Details
.compatible_schema?(constraints) ⇒ Boolean
54 55 56 57 |
# File 'lib/inspec/run_data.rb', line 54 def self.compatible_schema?(constraints) reqs = Gem::Requirement.create(constraints) reqs.satisfied_by?(Gem::Version.new(SCHEMA_VERSION)) end |