Sha256: e2b1ac4ab11a24ac1bf5caa1ea39eed8be0d8bb6d09b744dc755b8396f038a49

Contents?: true

Size: 525 Bytes

Versions: 2

Compression:

Stored size: 525 Bytes

Contents

# frozen_string_literal: true

#
# Copyright (c) 2019-present, Blue Marble Payroll, LLC
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#

module Proforma
  # Let's provide a refinenment instead of monkey-patching Hash.  That way we can stop
  # polluting other libraries and internalize our specific needs.
  module HashRefinements
    refine Hash do
      def symbolize_keys
        map { |k, v| [k.to_sym, v] }.to_h
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
proforma-1.0.1 lib/proforma/hash_refinements.rb
proforma-1.0.0 lib/proforma/hash_refinements.rb