Sha256: dd3db9b8623bc1a8781c665f5e33829b776139053d487aa8f22c35fd88446001

Contents?: true

Size: 321 Bytes

Versions: 1

Compression:

Stored size: 321 Bytes

Contents

module FeatureFlagMonitor::Refinements::HashExtensions
  refine Hash do
    def slice(*keys)
      keys.each_with_object({}) { |key, hash| hash[key] = self[key] }
    end

    def compact
      reject { |_, value| value.nil? }
    end

    def map_values(&block)
      keys.zip(values.map(&block)).to_h
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
feature-flag-monitor-0.5.4 lib/feature_flag_monitor/refinements/hash_extensions.rb