class Hash

Monkey patch hash to support xml array and xml object

Public Class Methods

xml_array(content, *path) click to toggle source
# File lib/aliyun/mqs.rb, line 10
def self.xml_array content, *path
  o = xml_object(content, *path)
  return (o.is_a?(Array) ? o : [o]).reject{|n| n.empty?}
end
xml_object(content, *path) click to toggle source
# File lib/aliyun/mqs.rb, line 15
def self.xml_object content, *path
  h = from_xml(content)
  path.reduce(h){|memo, node|  memo = memo[node] || {}}
end