module Noder::Utils

Public Class Methods

slice_hash(hash, keys) click to toggle source
# File lib/noder/utils.rb, line 5
def slice_hash(hash, keys)
  keys.each_with_object({}) { |k, new_hash| new_hash[k] = hash[k] if hash.has_key?(k) }
end

Private Instance Methods

slice_hash(hash, keys) click to toggle source
# File lib/noder/utils.rb, line 5
def slice_hash(hash, keys)
  keys.each_with_object({}) { |k, new_hash| new_hash[k] = hash[k] if hash.has_key?(k) }
end