module Jekyll::Minibundle::Hashes
Public Class Methods
dig(obj, *keys)
click to toggle source
# File lib/jekyll/minibundle/hashes.rb 5 def self.dig(obj, *keys) 6 value = obj 7 keys.each do |key| 8 return nil unless value 9 10 value = value[key] 11 end 12 value 13 end
pick(hash, *keys)
click to toggle source
# File lib/jekyll/minibundle/hashes.rb 15 def self.pick(hash, *keys) 16 keys.each_with_object({}) do |key, acc| 17 acc[key] = hash.fetch(key) 18 end 19 end