title: Convert Class Object to string in Ruby
body: <p>I m in a situation where i need to convert an Object to string so that i can check for Invalid characters/HTML in any filed of that object.</p>
  
  <p>Here is my function for spam check</p>
  
  <pre><code>def seems_spam?(str)
     flag = str.match(/&lt;.*&gt;/m) || str.match(/http/) || str.match(/href=/)
     Rails.logger.info "** was spam #{flag}"
     flag
  end
  </code></pre>
  
  <p>This method use a string and look for wrong data but i don't know how to convert an object to string and pass to this method. I tried this</p>
  
  <pre><code>@request = Request
  spam = seems_spam?(@request.to_s)
  </code></pre>
  
  <p>Please guide</p>
  
  <p>Thanks</p>