Sha256: 0c610950c019d57414e653ad40f4ed12b7f37312a1bc4a120ff835fe2a0bac96
Contents?: true
Size: 939 Bytes
Versions: 15
Compression:
Stored size: 939 Bytes
Contents
# frozen_string_literal: true ## # @example: # ConvenientService::Utils::Hash::Except.call({foo: :bar, baz: :qux}, [:foo]) # module ConvenientService module Utils module Hash class Except < Support::Command ## # @!attribute [r] hash # @return [Hash] # attr_reader :hash ## # @!attribute [r] keys # @return [Array] # attr_reader :keys ## # @param hash [Hash] # @param keys [Array] # @return [void] # def initialize(hash, keys) @hash = hash @keys = keys end ## # @return [Hash] # # @internal # NOTE: Copied with minimal modifications from: # https://api.rubyonrails.org/classes/Hash.html#method-i-except # def call hash.slice(*hash.keys - keys) end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems