Class: AppInsights::BaseInstaller
- Inherits:
-
Object
- Object
- AppInsights::BaseInstaller
- Defined in:
- lib/appinsights/installers/base.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
Returns the value of attribute app.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#root ⇒ Object
Returns the value of attribute root.
Instance Method Summary collapse
-
#initialize(app, root, filename = nil, logger = nil) ⇒ BaseInstaller
constructor
A new instance of BaseInstaller.
- #install ⇒ Object
Constructor Details
#initialize(app, root, filename = nil, logger = nil) ⇒ BaseInstaller
5 6 7 |
# File 'lib/appinsights/installers/base.rb', line 5 def initialize(app, root, filename = nil, logger = nil) @app, @root, @filename, @logger = app, root, filename, logger end |
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app.
3 4 5 |
# File 'lib/appinsights/installers/base.rb', line 3 def app @app end |
#filename ⇒ Object
Returns the value of attribute filename.
3 4 5 |
# File 'lib/appinsights/installers/base.rb', line 3 def filename @filename end |
#logger ⇒ Object
Returns the value of attribute logger.
3 4 5 |
# File 'lib/appinsights/installers/base.rb', line 3 def logger @logger end |
#root ⇒ Object
Returns the value of attribute root.
3 4 5 |
# File 'lib/appinsights/installers/base.rb', line 3 def root @root end |
Instance Method Details
#install ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/appinsights/installers/base.rb', line 9 def install AppInsights::ConfigLoader.new @root, @filename AppInsights::Middlewares.enabled.each do |middleware, args| @app.use middleware, *args.values end rescue AppInsights::ConfigFileNotFound => e logger.error e. logger.info end |