Class: Lumberjack::Tags

Inherits:
Object
  • Object
show all
Defined in:
lib/lumberjack/tags.rb

Class Method Summary collapse

Class Method Details

.expand_runtime_values(hash) ⇒ Hash

Deprecated.

Alias to AttributesHelper.expand_runtime_values

Parameters:

  • hash (Hash)

    The hash to transform.

Returns:

  • (Hash)

    The hash with string keys and expanded values.



29
30
31
32
33
# File 'lib/lumberjack/tags.rb', line 29

def expand_runtime_values(hash)
  Utils.deprecated("Lumberjack::Tags.expand_runtime_values", "Lumberjack::Tags.expand_runtime_values is deprecated and will be removed in version 2.1; use Lumberjack::AttributesHelper.expand_runtime_values instead.") do
    AttributesHelper.expand_runtime_values(hash)
  end
end

.stringify_keys(hash) ⇒ Hash

Deprecated.

No longer supported

Transform hash keys to strings. This method exists for optimization and backward compatibility. If a hash already has string keys, it will be returned as is.

Parameters:

  • hash (Hash)

    The hash to transform.

Returns:

  • (Hash)

    The hash with string keys.



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/lumberjack/tags.rb', line 12

def stringify_keys(hash)
  Utils.deprecated("Lumberjack::Tags.stringify_keys", "Lumberjack::Tags.stringify_keys is no longer supported and will be removed in version 2.1") do
    return nil if hash.nil?

    if hash.keys.all? { |key| key.is_a?(String) }
      hash
    else
      hash.transform_keys(&:to_s)
    end
  end
end