Class: Pennyworth::CLI::Configuration::Loader
- Inherits:
-
Object
- Object
- Pennyworth::CLI::Configuration::Loader
- Defined in:
- lib/pennyworth/cli/configuration/loader.rb
Overview
Represents the fully assembled Command Line Interface (CLI) configuration.
Constant Summary collapse
- DEFAULTS =
YAML.load_file(Pathname(__dir__).join("defaults.yml")).freeze
- HANDLER =
Runcom::Config.new "#{Identity::NAME}/configuration.yml", defaults: DEFAULTS
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(content: Content.new, handler: HANDLER) ⇒ Loader
constructor
A new instance of Loader.
Constructor Details
#initialize(content: Content.new, handler: HANDLER) ⇒ Loader
Returns a new instance of Loader.
24 25 26 27 |
# File 'lib/pennyworth/cli/configuration/loader.rb', line 24 def initialize content: Content.new, handler: HANDLER @content = content @handler = handler end |
Class Method Details
.call ⇒ Object
20 |
# File 'lib/pennyworth/cli/configuration/loader.rb', line 20 def self.call = new.call |
.with_defaults ⇒ Object
22 |
# File 'lib/pennyworth/cli/configuration/loader.rb', line 22 def self.with_defaults = new(handler: DEFAULTS) |
Instance Method Details
#call ⇒ Object
29 |
# File 'lib/pennyworth/cli/configuration/loader.rb', line 29 def call = content.merge(**handler.to_h.flatten_keys) |