Class: Qonfig::Commands::Definition::LoadFromVault Private

Inherits:
Base
  • Object
show all
Defined in:
lib/qonfig/plugins/vault/commands/definition/load_from_vault.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Since:

  • 0.25.0

Version:

  • 0.29.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

inheritable=, inheritable?, #inheritable?, inherited

Constructor Details

#initialize(path, strict: true, replace_on_merge: false) ⇒ LoadFromVault

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of LoadFromVault.

Parameters:

  • path (String)
  • strict (Hash) (defaults to: true)

    a customizable set of options

  • replace_on_merge (Hash) (defaults to: false)

    a customizable set of options

Options Hash (strict:):

  • (Boolean)

Options Hash (replace_on_merge:):

  • (Boolean)

Since:

  • 0.25.0

Version:

  • 0.29.0



35
36
37
38
39
# File 'lib/qonfig/plugins/vault/commands/definition/load_from_vault.rb', line 35

def initialize(path, strict: true, replace_on_merge: false)
  @path = path
  @strict = strict
  @replace_on_merge = replace_on_merge
end

Instance Attribute Details

#pathString, Pathname (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (String, Pathname)

Since:

  • 0.25.0



14
15
16
# File 'lib/qonfig/plugins/vault/commands/definition/load_from_vault.rb', line 14

def path
  @path
end

#replace_on_mergeBoolean (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)

Since:

  • 0.29.0



26
27
28
# File 'lib/qonfig/plugins/vault/commands/definition/load_from_vault.rb', line 26

def replace_on_merge
  @replace_on_merge
end

#strictBoolean (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)

Since:

  • 0.25.0



20
21
22
# File 'lib/qonfig/plugins/vault/commands/definition/load_from_vault.rb', line 20

def strict
  @strict
end

Instance Method Details

#call(_data_set, settings) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Parameters:

Since:

  • 0.25.0

Version:

  • 0.29.0



48
49
50
51
52
# File 'lib/qonfig/plugins/vault/commands/definition/load_from_vault.rb', line 48

def call(_data_set, settings)
  vault_data = Qonfig::Loaders::Vault.load_file(path, fail_on_unexist: strict)
  vault_based_settings = build_data_set_klass(vault_data).new.settings
  settings.__append_settings__(vault_based_settings, with_redefinition: replace_on_merge)
end