Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/facebook_ads/ruby2patch.rb

Overview

This source code is licensed under the license found in the LICENSE file in the root directory of this source tree.

Instance Method Summary collapse

Instance Method Details

#compactObject



12
13
14
# File 'lib/facebook_ads/ruby2patch.rb', line 12

def compact
  self.select { |_, value| !value.nil? }
end

#dig(k, *ks) ⇒ Object



8
9
10
# File 'lib/facebook_ads/ruby2patch.rb', line 8

def dig(k, *ks)
  key?(k) ? (ks.empty? ? self[k] : self[k].dig(*ks)) : nil
end