Class: Qonfig::Uploaders::File Private

Inherits:
Base
  • Object
show all
Defined in:
lib/qonfig/uploaders/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.11.0

Direct Known Subclasses

JSON, TOML, YAML

Constant Summary collapse

FILE_OPENING_MODE =

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:

  • (String)

Since:

  • 0.11.0

'w'
EMPTY_SETTINGS_REPRESENTATION =

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:

  • (String)

Since:

  • 0.11.0

''
DEFAULT_OPTIONS =

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:

  • (Hash)

Since:

  • 0.11.0

{}.freeze

Class Method Summary collapse

Class Method Details

.upload(settings, path:, options: self::DEFAULT_OPTIONS, &value_processor) ⇒ 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:

  • settings (Qonfig::Settings)
  • value_processor (Block)
  • path (Hash)

    a customizable set of options

  • options (Hash) (defaults to: self::DEFAULT_OPTIONS)

    a customizable set of options

Options Hash (path:):

  • (String, Pathname)

Options Hash (options:):

  • (Hash<Symbol|String,Any>)

Since:

  • 0.11.0



33
34
35
36
37
38
# File 'lib/qonfig/uploaders/file.rb', line 33

def upload(settings, path:, options: self::DEFAULT_OPTIONS, &value_processor)
  ::File.open(path, FILE_OPENING_MODE) do |file_descriptor|
    settings_representation = represent_settings(settings, options, &value_processor)
    file_descriptor.write(settings_representation)
  end
end