Class: Qonfig::Commands::Instantiation::ValuesFile Private

Inherits:
Base
  • Object
show all
Defined in:
lib/qonfig/commands/instantiation/values_file.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.17.0

Constant Summary collapse

SELF_LOCATED_FILE_DEFINITION =

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

Returns:

  • (Symbol)

Since:

  • 0.17.0

:self
NO_EXPOSE =

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

Returns:

  • (NilClass)

Since:

  • 0.17.0

nil
DEFAULT_STRICT_BEHAVIOR =

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

Returns:

  • (Boolean)

Since:

  • 0.17.0

false
DEFAULT_FORMAT =

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

Returns:

  • (Symbol)

Since:

  • 0.17.0

:dynamic

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

inheritable=, inheritable?, #inheritable?, inherited

Constructor Details

#initialize(file_path, caller_location, format: DEFAULT_FORMAT, strict: DEFAULT_STRICT_BEHAVIOR, expose: NO_EXPOSE) ⇒ 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.

Parameters:

  • file_path (String, Symbol, Pathname)
  • caller_location (String)
  • format (Hash) (defaults to: DEFAULT_FORMAT)

    a customizable set of options

  • strict (Hash) (defaults to: DEFAULT_STRICT_BEHAVIOR)

    a customizable set of options

  • expose (Hash) (defaults to: NO_EXPOSE)

    a customizable set of options

Options Hash (format:):

  • (String, Symbol)

Options Hash (strict:):

  • (Boolean)

Options Hash (expose:):

  • (NilClass, String, Symbol)

Since:

  • 0.17.0

Version:

  • 0.22.0



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/qonfig/commands/instantiation/values_file.rb', line 74

def initialize(
  file_path,
  caller_location,
  format: DEFAULT_FORMAT,
  strict: DEFAULT_STRICT_BEHAVIOR,
  expose: NO_EXPOSE
)
  prevent_incompatible_attributes!(file_path, format, strict, expose)

  @file_path = file_path
  @caller_location = caller_location
  @format = format
  @strict = strict
  @expose = expose
end

Instance Attribute Details

#caller_locationString (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)

Since:

  • 0.17.0



44
45
46
# File 'lib/qonfig/commands/instantiation/values_file.rb', line 44

def caller_location
  @caller_location
end

#exposeNilClass, ... (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:

  • (NilClass, String, Symbol)

Since:

  • 0.17.0



62
63
64
# File 'lib/qonfig/commands/instantiation/values_file.rb', line 62

def expose
  @expose
end

#file_pathString, ... (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, Symbol, Pathname)

Since:

  • 0.17.0

Version:

  • 0.22.0



38
39
40
# File 'lib/qonfig/commands/instantiation/values_file.rb', line 38

def file_path
  @file_path
end

#formatString, Symbol (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, Symbol)

Since:

  • 0.17.0



50
51
52
# File 'lib/qonfig/commands/instantiation/values_file.rb', line 50

def format
  @format
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.17.0



56
57
58
# File 'lib/qonfig/commands/instantiation/values_file.rb', line 56

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.17.0



96
97
98
99
100
101
# File 'lib/qonfig/commands/instantiation/values_file.rb', line 96

def call(data_set, settings)
  settings_values = load_settings_values
  return unless settings_values
  settings_values = (settings_values[expose.to_sym] || settings_values[expose.to_s]) if expose
  data_set.configure(settings_values) if settings_values
end