Class: Oldfixversion::Configuration::Loader

Inherits:
Object
  • Object
show all
Defined in:
lib/oldfixversion/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
CLIENT =
Runcom::Config.new "oldfixversion/configuration.yml", defaults: DEFAULTS

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content: Content.new, client: CLIENT) ⇒ Loader

Returns a new instance of Loader.



23
24
25
26
# File 'lib/oldfixversion/configuration/loader.rb', line 23

def initialize content: Content.new, client: CLIENT
  @content = content
  @client = client
end

Class Method Details

.callObject



19
# File 'lib/oldfixversion/configuration/loader.rb', line 19

def self.call = new.call

.with_defaultsObject



21
# File 'lib/oldfixversion/configuration/loader.rb', line 21

def self.with_defaults = new client: DEFAULTS

Instance Method Details

#callObject



28
# File 'lib/oldfixversion/configuration/loader.rb', line 28

def call = content.merge(**client.to_h.flatten_keys).freeze