Class: Tender::Queue

Inherits:
Object
  • Object
show all
Defined in:
lib/tender/queue.rb

Class Method Summary collapse

Class Method Details

.add(url_template, queue_id) ⇒ Object

Raises:



3
4
5
6
7
8
9
10
11
# File 'lib/tender/queue.rb', line 3

def self.add(url_template, queue_id)
  headers = { 
    'X-Tender-Auth' => Tender.auth_token, 
    'Accept' => 'application/json'
  }  
  tmpl = Addressable::Template.new(url_template)
  resp = HTTParty.post(tmpl.expand('queue_id' => queue_id).to_s, :headers => headers, :body => "")
  raise TenderError, "Discussion was not added to queue. Response was: #{resp.body}" unless resp.code == 200
end