Class: Qonfig::Uploaders::JSON Private

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

Constant Summary collapse

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<Symbol,Any>)

Since:

  • 0.11.0

{
  indent: ' ',
  space: ' ',
  object_nl: "\n"
}.freeze

Constants inherited from File

File::EMPTY_SETTINGS_REPRESENTATION, File::FILE_OPENING_MODE

Class Method Summary collapse

Methods inherited from File

upload

Methods inherited from Base

upload

Class Method Details

.represent_settings(settings, options, &value_processor) ⇒ String

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:

  • settings (Qonfig::Settings)
  • options (Hash<Symbol,Any>)
  • value_processor (Block)

Returns:

  • (String)

Since:

  • 0.11.0



24
25
26
27
28
29
30
31
32
33
# File 'lib/qonfig/uploaders/json.rb', line 24

def represent_settings(settings, options, &value_processor)
  settings_hash =
    if block_given?
      settings.__to_hash__(transform_value: value_processor)
    else
      settings.__to_hash__
    end

  ::JSON.generate(settings_hash, options)
end