title: setting timeout for response for API connection
body: <p>A Rails controller action has a condition whereby, when met, connects to an API</p>
  
  <pre><code>Class GuestController
    if @book.quantity - @book.guests.count == 0
       call_book_api
  </code></pre>
  
  <p>Now this particular call should have a response time that will differ from other calls.  A Timeout needs to be set regarding the response of <code>call_book_api</code> method with some data (be it positive or negative).</p>
  
  <pre><code>@result = HTTParty.post(
    'https://test.co.uk/interface/Book', 
    :body =&gt; JSON.parse(@book).to_json,
    headers: {
      'Content-Type' =&gt; 'application/json', 
      'Accept' =&gt; 'application/json',
      'Host' =&gt; 'test.co.uk',
      'Connection' =&gt; 'Keep-Alive'
    }
  )    
  </code></pre>
  
  <p>How can this be efficiently defined at the action level?</p>