Class: PolishGeeks::DevTools::ConfigManager
- Inherits:
-
Object
- Object
- PolishGeeks::DevTools::ConfigManager
- Defined in:
- lib/polish_geeks/dev_tools/config_manager.rb
Overview
Config manager which is able to check if config file exist either in local or application path
Instance Method Summary collapse
-
#initialize(file_name) ⇒ ConfigManager
constructor
A new instance of ConfigManager.
-
#path ⇒ String
If there is an application config file use that, if not check if local config file is available if not return nil.
-
#present? ⇒ Boolean
True if there is a local or application config file present.
Constructor Details
#initialize(file_name) ⇒ ConfigManager
Returns a new instance of ConfigManager.
10 11 12 |
# File 'lib/polish_geeks/dev_tools/config_manager.rb', line 10 def initialize(file_name) @file_name = file_name end |
Instance Method Details
#path ⇒ String
If there is an application config file use that, if not check if local config file is available if not return nil
24 25 26 |
# File 'lib/polish_geeks/dev_tools/config_manager.rb', line 24 def path application? ? application_path : local_path end |
#present? ⇒ Boolean
Returns true if there is a local or application config file present.
15 16 17 |
# File 'lib/polish_geeks/dev_tools/config_manager.rb', line 15 def present? application? || local? end |