title: Rails Model Syntax Confusion
body: <p>I came across this code in Rails app using mongodb:</p>
  
  <pre><code>  """
   Folder format:
  {
    name: &lt;folder name&gt;,
    stocks: [
      {
        name: &lt;stock name&gt;,
        id: &lt;stock id&gt;,
        qty: &lt;stock quantity&gt;
      }
    ]
  }
   """
  
    def format_with_folders(stocks)
     fmap = stock_folder_map
     res = stocks.group_by {|s| fmap[s["id"]] }.collect {|fname, ss|
      {
       "name" =&gt; fname,
       "stocks" =&gt; ss
      }
    }
    new(folders: res)
   end
  
  
     def stock_folder_map
       res = {}
       folders.each { |ff|
         ff.stocks.each { |s|
           res[s["id"]] = ff["name"]
         }
       }
      return res
     end
   end
  </code></pre>
  
  <p>The doubts are:
  1) What does the code inside triple quote signify? Is is a commented code?
  2)What would be the right format to use this code inside a ruby script?</p>