# File lib/aws/sqs/queue.rb, line 162
      def receive_message(opts = {}, &block)
        resp = client.receive_message(receive_opts(opts))

        messages = resp.messages.map do |m|
          ReceivedMessage.new(self, m.message_id, m.receipt_handle,
                              :body => m.body,
                              :md5 => m.md5_of_body,
                              :attributes => m.attributes)
        end

        if block
          call_message_block(messages, block)
        elsif opts[:limit] && opts[:limit] != 1
          messages
        else
          messages.first
        end
      end