Class: SpotifyExporter::ConfigManager
- Inherits:
-
Object
- Object
- SpotifyExporter::ConfigManager
- Includes:
- Singleton
- Defined in:
- lib/spotifyexporter/config.rb
Constant Summary collapse
- DEFAULT_CONFIG_DIR =
".config/spotifyexporter"- FILE_CLI_CONFIG =
"config.yml"
Instance Attribute Summary collapse
-
#config_path ⇒ Object
readonly
Returns the value of attribute config_path.
Instance Method Summary collapse
-
#config ⇒ AppConfig
Retrieves the AppConfig.
-
#save_credentials(client_id:, secret:) ⇒ Boolean
Loads and saves the credentials to the main configuration.
Instance Attribute Details
#config_path ⇒ Object (readonly)
Returns the value of attribute config_path.
46 47 48 |
# File 'lib/spotifyexporter/config.rb', line 46 def config_path @config_path end |
Instance Method Details
#config ⇒ AppConfig
Retrieves the AppConfig
71 72 73 74 75 |
# File 'lib/spotifyexporter/config.rb', line 71 def config load_config_file unless config_loaded? @app_config end |
#save_credentials(client_id:, secret:) ⇒ Boolean
Loads and saves the credentials to the main configuration
57 58 59 60 61 62 63 64 |
# File 'lib/spotifyexporter/config.rb', line 57 def save_credentials(client_id:, secret:) load_config_file unless config_loaded? @app_config.spotify_client_id = client_id @app_config.spotify_client_secret = secret save_config! end |