Sha256: d915dd01f6ea72fa433542aecf564eef2ee0bdc7811fd3b83336a59768de24ed

Contents?: true

Size: 490 Bytes

Versions: 1

Compression:

Stored size: 490 Bytes

Contents

# frozen_string_literal: true

class Hash
  # The opposite of +Hash.except+.
  # ~/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.5/lib/active_support/core_ext/hash/except.rb
  # https://apidock.com/rails/Hash/except
  #
  # Selects only the supplied keys.
  #
  # http://api.rubyonrails.org/classes/Hash.html#method-i-slice
  #
  def only(*keys)
    slice(*keys)
  end

  # See +only+
  #
  # http://apidock.com/rails/v4.1.8/Hash/extract%21
  #
  def only!(*keys)
    slice!(*keys)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hash_only_extension-0.0.1 lib/hash_only_extension.rb