Class: Qonfig::Commands::ExposeTOML Private
- Defined in:
- lib/qonfig/plugins/toml/commands/expose_toml.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.
Constant Summary collapse
- EXPOSERS =
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.
{ file_name: :file_name, env_key: :env_key }.freeze
- EMPTY_TOML_DATA =
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.
{}.freeze
Instance Attribute Summary collapse
- #env ⇒ Symbol, String readonly private
- #file_path ⇒ String readonly private
- #strict ⇒ Boolean readonly private
- #via ⇒ Symbol readonly private
Instance Method Summary collapse
- #call(data_set, settings) ⇒ void private
-
#initialize(file_path, strict: true, via:, env:) ⇒ ExposeTOML
constructor
private
A new instance of ExposeTOML.
Constructor Details
#initialize(file_path, strict: true, via:, env:) ⇒ ExposeTOML
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 ExposeTOML.
49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/qonfig/plugins/toml/commands/expose_toml.rb', line 49 def initialize(file_path, strict: true, via:, env:) unless env.is_a?(Symbol) || env.is_a?(String) || env.is_a?(Numeric) raise Qonfig::ArgumentError, ':env should be a string or a symbol' end raise Qonfig::ArgumentError, ':env should be provided' if env.to_s.empty? raise Qonfig::ArgumentError, 'used :via is unsupported' unless EXPOSERS.key?(via) @file_path = file_path @strict = strict @via = via @env = env end |
Instance Attribute Details
#env ⇒ Symbol, 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.
40 41 42 |
# File 'lib/qonfig/plugins/toml/commands/expose_toml.rb', line 40 def env @env end |
#file_path ⇒ 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.
22 23 24 |
# File 'lib/qonfig/plugins/toml/commands/expose_toml.rb', line 22 def file_path @file_path end |
#strict ⇒ Boolean (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.
28 29 30 |
# File 'lib/qonfig/plugins/toml/commands/expose_toml.rb', line 28 def strict @strict end |
#via ⇒ 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.
34 35 36 |
# File 'lib/qonfig/plugins/toml/commands/expose_toml.rb', line 34 def via @via 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.
69 70 71 72 73 74 75 76 |
# File 'lib/qonfig/plugins/toml/commands/expose_toml.rb', line 69 def call(data_set, settings) case via when EXPOSERS[:file_name] expose_file_name!(settings) when EXPOSERS[:env_key] expose_env_key!(settings) end end |