Class: Contrast::Components::Inventory::Interface
- Includes:
- ComponentBase
- Defined in:
- lib/contrast/components/inventory.rb
Overview
Interface component for Inventory settings used to store the values from settings file and assert state with check methods.
Constant Summary collapse
- CANON_NAME =
'inventory'
- CONFIG_VALUES =
%w[enable analyze_libraries tags].cs__freeze
Constants included from ComponentBase
Constants included from Contrast::Config::Diagnostics::Tools
Contrast::Config::Diagnostics::Tools::CHECK
Constants included from Contrast::Config::Diagnostics::SingletonTools
Contrast::Config::Diagnostics::SingletonTools::API_CREDENTIALS, Contrast::Config::Diagnostics::SingletonTools::CONTRAST_MARK
Instance Attribute Summary collapse
- #canon_name ⇒ String readonly
- #config_values ⇒ Array readonly
-
#tags ⇒ String?
Tags.
Instance Method Summary collapse
-
#analyze_libraries ⇒ Object
return [Boolean].
-
#enable ⇒ Object
return [Boolean].
-
#initialize(hsh = {}) ⇒ Interface
constructor
A new instance of Interface.
Methods included from ComponentBase
#false?, #file_exists?, #stringify_array, #to_effective_config, #true?, #valid_cert?
Methods included from Contrast::Config::Diagnostics::Tools
#add_effective_config_values, #add_single_effective_value
Methods included from Contrast::Config::Diagnostics::SingletonTools
#flatten_settings, #to_config_values, #update_config, #value_to_s
Constructor Details
#initialize(hsh = {}) ⇒ Interface
Returns a new instance of Interface.
23 24 25 26 27 28 29 30 31 |
# File 'lib/contrast/components/inventory.rb', line 23 def initialize hsh = {} @config_values = CONFIG_VALUES @canon_name = CANON_NAME return unless hsh @enable = !false?(hsh[:enable]) @analyze_libraries = !false?(hsh[:analyze_libraries]) @tags = hsh[:tags] end |
Instance Attribute Details
#canon_name ⇒ String (readonly)
19 20 21 |
# File 'lib/contrast/components/inventory.rb', line 19 def canon_name @canon_name end |
#config_values ⇒ Array (readonly)
21 22 23 |
# File 'lib/contrast/components/inventory.rb', line 21 def config_values @config_values end |
#tags ⇒ String?
Returns tags.
44 45 46 |
# File 'lib/contrast/components/inventory.rb', line 44 def stringify_array(@tags) end |
Instance Method Details
#analyze_libraries ⇒ Object
return [Boolean]
39 40 41 |
# File 'lib/contrast/components/inventory.rb', line 39 def analyze_libraries @analyze_libraries.nil? ? true : @analyze_libraries end |
#enable ⇒ Object
return [Boolean]
34 35 36 |
# File 'lib/contrast/components/inventory.rb', line 34 def enable @enable.nil? ? true : @enable end |