lib/contrast/components/inventory.rb in contrast-agent-6.8.0 vs lib/contrast/components/inventory.rb in contrast-agent-6.9.0
- old
+ new
@@ -9,14 +9,22 @@
# Interface component for Inventory settings used to store the values from
# settings file and assert state with check methods.
class Interface
include Contrast::Components::ComponentBase
- # @return [Array, nil] tags
- attr_accessor :tags
+ CANON_NAME = 'inventory'
+ CONFIG_VALUES = %w[enable analyze_libraries tags].cs__freeze
+ attr_writer :tags
+ # @return [String]
+ attr_reader :canon_name
+ # @return [Array]
+ attr_reader :config_values
+
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]
@@ -28,9 +36,14 @@
end
# return [Boolean]
def analyze_libraries
@analyze_libraries.nil? ? true : @analyze_libraries
+ end
+
+ # @return [String, nil] tags
+ def tags
+ stringify_array(@tags)
end
end
end
end
end