Class: PushClient::Publisher

Inherits:
Communicator show all
Defined in:
lib/push-client.rb

Constant Summary

Constants inherited from Communicator

Communicator::HEADERS

Instance Method Summary collapse

Constructor Details

#initialize(hub) {|_self| ... } ⇒ Publisher

Returns a new instance of Publisher.

Yields:

  • (_self)

Yield Parameters:



45
46
47
48
# File 'lib/push-client.rb', line 45

def initialize(hub)
  super(hub)
  yield self if block_given?
end

Instance Method Details

#publish(*feeds) ⇒ Object



50
51
52
53
54
55
56
# File 'lib/push-client.rb', line 50

def publish(*feeds)
  
  feeds.flatten.each do |f|
    self.class.post("#{@hub}", :body => {'hub.mode' => 'publish', 'hub.url' => f}, :headers => HEADERS)
  end
  
end