Class: OpenRTB::Client::Queue

Inherits:
Object
  • Object
show all
Includes:
NullObject::Conversions
Defined in:
lib/openrtb/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(client, hydra) ⇒ Queue

Returns a new instance of Queue.



16
17
18
19
# File 'lib/openrtb/client.rb', line 16

def initialize(client, hydra)
  @client = client
  @hydra  = hydra
end

Instance Method Details

#post(endpoint, body = {}) ⇒ Object



25
26
27
28
29
30
# File 'lib/openrtb/client.rb', line 25

def post(endpoint, body = {})
  req = request(endpoint, :post, OpenRTB::Request.new(body))
  req.on_complete { |res| responses << res }

  @hydra.queue req
end

#responsesObject



21
22
23
# File 'lib/openrtb/client.rb', line 21

def responses
  @responses ||= []
end