Class: DeployRubygem::InspecTestorResult
- Inherits:
-
Object
- Object
- DeployRubygem::InspecTestorResult
- Defined in:
- lib/deploy_rubygem/inspec_result.rb
Overview
Using Inspec to deploy and manage Inspec
Instance Attribute Summary collapse
-
#failed_control ⇒ Object
readonly
Returns the value of attribute failed_control.
-
#failed_profiles ⇒ Object
readonly
Returns the value of attribute failed_profiles.
-
#failed_result ⇒ Object
readonly
Returns the value of attribute failed_result.
-
#pending_control ⇒ Object
readonly
Returns the value of attribute pending_control.
-
#pending_result ⇒ Object
readonly
Returns the value of attribute pending_result.
-
#success_control ⇒ Object
readonly
Returns the value of attribute success_control.
-
#success_profiles ⇒ Object
readonly
Returns the value of attribute success_profiles.
-
#success_result ⇒ Object
readonly
Returns the value of attribute success_result.
Instance Method Summary collapse
- #controls ⇒ Object
-
#initialize(as_json) ⇒ InspecTestorResult
constructor
A new instance of InspecTestorResult.
- #profile ⇒ Object
- #result_summary ⇒ Object
- #status ⇒ Object
Constructor Details
#initialize(as_json) ⇒ InspecTestorResult
Returns a new instance of InspecTestorResult.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/deploy_rubygem/inspec_result.rb', line 10 def initialize(as_json) @as_json = as_json @success_control = 0 @success_result = 0 @failed_control = 0 @failed_result = 0 @pending_control = 0 @pending_result = 0 @success_profiles = [] @failed_profiles = [] results end |
Instance Attribute Details
#failed_control ⇒ Object (readonly)
Returns the value of attribute failed_control.
8 9 10 |
# File 'lib/deploy_rubygem/inspec_result.rb', line 8 def failed_control @failed_control end |
#failed_profiles ⇒ Object (readonly)
Returns the value of attribute failed_profiles.
8 9 10 |
# File 'lib/deploy_rubygem/inspec_result.rb', line 8 def failed_profiles @failed_profiles end |
#failed_result ⇒ Object (readonly)
Returns the value of attribute failed_result.
8 9 10 |
# File 'lib/deploy_rubygem/inspec_result.rb', line 8 def failed_result @failed_result end |
#pending_control ⇒ Object (readonly)
Returns the value of attribute pending_control.
8 9 10 |
# File 'lib/deploy_rubygem/inspec_result.rb', line 8 def pending_control @pending_control end |
#pending_result ⇒ Object (readonly)
Returns the value of attribute pending_result.
8 9 10 |
# File 'lib/deploy_rubygem/inspec_result.rb', line 8 def pending_result @pending_result end |
#success_control ⇒ Object (readonly)
Returns the value of attribute success_control.
8 9 10 |
# File 'lib/deploy_rubygem/inspec_result.rb', line 8 def success_control @success_control end |
#success_profiles ⇒ Object (readonly)
Returns the value of attribute success_profiles.
8 9 10 |
# File 'lib/deploy_rubygem/inspec_result.rb', line 8 def success_profiles @success_profiles end |
#success_result ⇒ Object (readonly)
Returns the value of attribute success_result.
8 9 10 |
# File 'lib/deploy_rubygem/inspec_result.rb', line 8 def success_result @success_result end |
Instance Method Details
#controls ⇒ Object
31 32 33 |
# File 'lib/deploy_rubygem/inspec_result.rb', line 31 def controls profile['controls'] end |
#profile ⇒ Object
23 24 25 |
# File 'lib/deploy_rubygem/inspec_result.rb', line 23 def profile @as_json['profiles'].first end |
#result_summary ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/deploy_rubygem/inspec_result.rb', line 35 def result_summary { success_control: success_control, success_result: success_result, failed_control: failed_control, failed_result: failed_result, pending_control: pending_control, pending_result: pending_result } end |
#status ⇒ Object
27 28 29 |
# File 'lib/deploy_rubygem/inspec_result.rb', line 27 def status profile['status'] end |