Class: Qonfig::Commands::Definition::LoadFromSelf Private
- Defined in:
- lib/qonfig/commands/definition/load_from_self.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.
Instance Attribute Summary collapse
- #caller_location ⇒ String readonly private
- #format ⇒ String, Symbol readonly private
Instance Method Summary collapse
- #call(data_set, settings) ⇒ void private
-
#initialize(caller_location, format:) ⇒ LoadFromSelf
constructor
private
A new instance of LoadFromSelf.
Methods inherited from Base
inheritable=, inheritable?, #inheritable?, inherited
Constructor Details
#initialize(caller_location, format:) ⇒ LoadFromSelf
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 LoadFromSelf.
26 27 28 29 30 31 32 33 |
# File 'lib/qonfig/commands/definition/load_from_self.rb', line 26 def initialize(caller_location, format:) unless format.is_a?(String) || format.is_a?(Symbol) raise Qonfig::ArgumentError, 'Format should be a symbol or a string' end @caller_location = caller_location @format = format.tap { Qonfig::Loaders.resolve(format) } end |
Instance Attribute Details
#caller_location ⇒ String (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.
19 20 21 |
# File 'lib/qonfig/commands/definition/load_from_self.rb', line 19 def caller_location @caller_location end |
#format ⇒ String, 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.
13 14 15 |
# File 'lib/qonfig/commands/definition/load_from_self.rb', line 13 def format @format 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.
41 42 43 44 45 46 |
# File 'lib/qonfig/commands/definition/load_from_self.rb', line 41 def call(data_set, settings) self_placed_end_data = load_self_placed_end_data self_placed_settings = build_data_set_klass(self_placed_end_data).new.settings settings.__append_settings__(self_placed_settings) end |