def attributes(*attributes)
      return nil if attributes.blank?

      values = {}
      response = client.get_queue_attributes(url, attributes)

      response.doc.xpath("//Attribute").each do |attribute_element|
        name = attribute_element.xpath("Name").text
        value = attribute_element.xpath("Value").text
        value = value.to_i if value =~ /\A\d+\z/
        values[name] = value
      end

      if values.size == 1 && attributes.size == 1
        values.values.first
      else
        values
      end
    end
def attributes(*attributes)
      return nil if attributes.blank?

      values = {}
      response = client.get_queue_attributes(url, attributes)

      response.doc.xpath("//Attribute").each do |attribute_element|
        name = attribute_element.xpath("Name").text
        value = attribute_element.xpath("Value").text
        value = value.to_i if value =~ /\A\d+\z/
        values[name] = value
      end

      if values.size == 1 && attributes.size == 1
        values.values.first
      else
        values
      end
    end
Return attributes for the queue. Pass in the names of the attributes to
 retrieve, or :All for all attributes. The available attributes can be
 found at
 http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/Query_QueryGetQueueAttributes.html

 If 1 attribute is requested then just that attributes value is returned.
 If more than one, or all, attributes are requested then a hash of
 attribute names and values is returned.

 @param [String] attributes
 @return [Object,Hash]

 @example with one attribute

   queue.attributes(:ApproximateNumberOfMessages) == 10

 @example with multiple attributes

   queue.attributes(:ApproximateNumberOfMessages, :ApproximateNumberOfMessagesDelayed) == {:ApproximateNumberOfMessages => 10, :ApproximateNumberOfMessagesDelayed => 5}