Class: Firehose::Client::Producer::Http::Builder

Inherits:
Object
  • Object
show all
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

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, message)
  @producer, @message = producer, message
  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