Hash
This class offers both Hash and OpenStruct functionality. We convert from the Core Hash to this before calling any of the display methods, in order to give the display methods a cleaner API for accessing the data.
This method converts from a Hash to an OpenStructHash.
# File rdoc/ri/driver.rb, line 24 def self.convert(object) case object when Hash then new_hash = new # Convert Hash -> OpenStructHash object.each do |key, value| new_hash[key] = convert(value) end new_hash when Array then object.map do |element| convert(element) end else object end end
# File rdoc/ri/driver.rb, line 43 def merge_enums(other) other.each do |k, v| if self[k] then case v when Array then # HACK dunno if String === self[k] and self[k].empty? then self[k] = v else self[k] += v end when Hash then self[k].update v else # do nothing end else self[k] = v end end end