Sha256: 9d50acab3952544fd9a9653fdfc2e68c05031326b5a502b4c5b7396c00bb6bb3

Contents?: true

Size: 421 Bytes

Versions: 1

Compression:

Stored size: 421 Bytes

Contents

# frozen_string_literal: true

require 'active_support'
require 'active_support/core_ext/hash'

module FeCoreExt::CoreExt
end

module FeCoreExt::CoreExt::Hash
  def snake_symbolize_keys
    transform_keys { |key| key.to_s.snakecase.to_sym }
  end

  def rename_key(original_key, new_key)
    self[new_key] = delete(original_key) if key?(original_key)
    self
  end
end

class Hash
  include FeCoreExt::CoreExt::Hash
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fe_core_ext-0.28.0 lib/fe_core_ext/core_ext/hash.rb