Class: OpenRTB::Client::Queue
- Inherits:
-
Object
- Object
- OpenRTB::Client::Queue
- Includes:
- NullObject::Conversions
- Defined in:
- lib/openrtb/client.rb
Instance Method Summary collapse
-
#initialize(client, hydra) ⇒ Queue
constructor
A new instance of Queue.
- #post(endpoint, body = {}) ⇒ Object
- #responses ⇒ Object
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 |
#responses ⇒ Object
21 22 23 |
# File 'lib/openrtb/client.rb', line 21 def responses @responses ||= [] end |