module Ragol::HashUtil

Public Class Methods

copy_hash(to_hash, from_hash, fields = Array.new) click to toggle source
# File lib/ragol/hash.rb, line 6
def self.copy_hash to_hash, from_hash, fields = Array.new
  fields.each do |fieldnames|
    to_hash[fieldnames.first] = from_hash[fieldnames.find { |x| from_hash[x] }]
  end
end
hash_array_value(hash, array) click to toggle source
# File lib/ragol/hash.rb, line 12
def self.hash_array_value hash, array
  hash[(array & hash.keys)[0]]
end