Class: Helmsnap::Config
- Inherits:
-
Object
- Object
- Helmsnap::Config
- Defined in:
- lib/helmsnap/config.rb
Defined Under Namespace
Classes: Credentials
Constant Summary collapse
- DEFAULT_ENV =
"default"
- DEFAULT_SNAPSHOTS_PATH =
"helm/snapshots"
Instance Attribute Summary collapse
-
#credentials ⇒ Object
readonly
Returns the value of attribute credentials.
-
#envs ⇒ Object
readonly
Returns the value of attribute envs.
-
#snapshots_path ⇒ Object
readonly
Returns the value of attribute snapshots_path.
Instance Method Summary collapse
-
#initialize(config_path) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(config_path) ⇒ Config
Returns a new instance of Config.
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/helmsnap/config.rb', line 11 def initialize(config_path) if config_path.exist? yaml = YAML.load_file(config_path.to_s) else yaml = {} end self.envs = parse_envs(yaml) self.snapshots_path = parse_snaphots_path(yaml) self.credentials = parse_credentials(yaml) end |
Instance Attribute Details
#credentials ⇒ Object
Returns the value of attribute credentials.
6 7 8 |
# File 'lib/helmsnap/config.rb', line 6 def credentials @credentials end |
#envs ⇒ Object
Returns the value of attribute envs.
6 7 8 |
# File 'lib/helmsnap/config.rb', line 6 def envs @envs end |
#snapshots_path ⇒ Object
Returns the value of attribute snapshots_path.
6 7 8 |
# File 'lib/helmsnap/config.rb', line 6 def snapshots_path @snapshots_path end |