Class: AppMap::Service::ConfigAnalyzer
- Inherits:
-
Object
- Object
- AppMap::Service::ConfigAnalyzer
- Defined in:
- lib/appmap/service/config_analyzer.rb
Instance Attribute Summary collapse
-
#config_error ⇒ Object
readonly
Returns the value of attribute config_error.
Instance Method Summary collapse
- #app_name ⇒ Object
-
#initialize(config_file) ⇒ ConfigAnalyzer
constructor
A new instance of ConfigAnalyzer.
- #present? ⇒ Boolean
- #valid? ⇒ Boolean
Constructor Details
#initialize(config_file) ⇒ ConfigAnalyzer
Returns a new instance of ConfigAnalyzer.
8 9 10 11 |
# File 'lib/appmap/service/config_analyzer.rb', line 8 def initialize(config_file) @config_file = config_file @config = load_config end |
Instance Attribute Details
#config_error ⇒ Object (readonly)
Returns the value of attribute config_error.
6 7 8 |
# File 'lib/appmap/service/config_analyzer.rb', line 6 def config_error @config_error end |
Instance Method Details
#app_name ⇒ Object
13 14 15 |
# File 'lib/appmap/service/config_analyzer.rb', line 13 def app_name @config.to_h[:name] if present? end |
#present? ⇒ Boolean
17 18 19 |
# File 'lib/appmap/service/config_analyzer.rb', line 17 def present? File.exist?(@config_file) end |
#valid? ⇒ Boolean
21 22 23 |
# File 'lib/appmap/service/config_analyzer.rb', line 21 def valid? present? && @config.to_h.key?(:name) && @config.to_h.key?(:packages) end |