Class: Firehose::Client::Producer::Http::Builder
- Inherits:
-
Object
- Object
- Firehose::Client::Producer::Http::Builder
- Defined in:
- lib/firehose/client/producer.rb
Overview
A DSL for publishing requests. This doesn’t so much, but lets us call Firehose::Client::Producer::Http#publish(‘message’).to(‘channel’). Slick eh? If you don’t like it, just all Firehose::Client::Producer::Http#put(‘message’, ‘channel’)
Instance Method Summary collapse
-
#initialize(producer, message) ⇒ Builder
constructor
A new instance of Builder.
- #to(channel, opts = {}, &callback) ⇒ Object
Constructor Details
#initialize(producer, message) ⇒ Builder
Returns a new instance of Builder.
19 20 21 22 |
# File 'lib/firehose/client/producer.rb', line 19 def initialize(producer, ) @producer, @message = producer, self end |
Instance Method Details
#to(channel, opts = {}, &callback) ⇒ Object
24 25 26 |
# File 'lib/firehose/client/producer.rb', line 24 def to(channel, opts={}, &callback) @producer.put(@message, channel, opts, &callback) end |