Method: Qonfig::Commands::Definition::ExposeTOML#initialize

Defined in:
lib/qonfig/plugins/toml/commands/definition/expose_toml.rb

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

Parameters:

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

    a customizable set of options

  • via (Hash)

    a customizable set of options

  • env (Hash)

    a customizable set of options

Options Hash (strict:):

  • (Boolean)

Options Hash (via:):

  • (Symbol)

Options Hash (env:):

  • (String, Symbol)

Raises:

Since:

  • 0.12.0



53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/qonfig/plugins/toml/commands/definition/expose_toml.rb', line 53

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