136: def get_attributes(domain, item)
137: doc = call(
138: :get,
139: {
140: 'Action' => 'GetAttributes',
141: 'DomainName' => domain.to_s,
142: 'ItemName' => item.to_s
143: }
144: )
145: attributes = {}
146: if doc
147: REXML::XPath.each(doc, "//Attribute") do |attr|
148: key = REXML::XPath.first(attr, './Name/text()').to_s
149: value = REXML::XPath.first(attr, './Value/text()').to_s
150: ( attributes[key] ||= [] ) << value
151: end
152: end
153: attributes = nil if attributes.empty?
154: attributes
155: end