Sha256: 79e32bb16c4e1c8c6fa9a8e7dbf0ca9b59b5de8f174774b2f597ed034ec9ea5e

Contents?: true

Size: 262 Bytes

Versions: 9

Compression:

Stored size: 262 Bytes

Contents

# frozen_string_literal: true

module Flagsmith
  # Hash#slice was added in ruby version 2.5
  module HashSlice
    def slice(*keys)
      select { |key, _value| keys.include?(key) }
    end
  end
end

Hash.include Flagsmith::HashSlice if RUBY_VERSION < '2.5.0'

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
flagsmith-4.3.0 lib/flagsmith/hash_slice.rb
flagsmith-4.1.0 lib/flagsmith/hash_slice.rb
flagsmith-4.0.1 lib/flagsmith/hash_slice.rb
flagsmith-4.0.0 lib/flagsmith/hash_slice.rb
flagsmith-3.2.0 lib/flagsmith/hash_slice.rb
flagsmith-3.1.1 lib/flagsmith/hash_slice.rb
flagsmith-3.1.0 lib/flagsmith/hash_slice.rb
flagsmith-3.0.1 lib/flagsmith/hash_slice.rb
flagsmith-3.0.0 lib/flagsmith/hash_slice.rb