Class: OPub::Publisher

Inherits:
Object
  • Object
show all
Defined in:
lib/opub/publisher.rb

Instance Method Summary collapse

Constructor Details

#initialize(topic_url, hubs) ⇒ Publisher

Returns a new instance of Publisher.



6
7
8
9
# File 'lib/opub/publisher.rb', line 6

def initialize(topic_url, hubs)
  @topic_url = topic_url
  @hub_urls = hubs
end

Instance Method Details

#ping_hubsObject



11
12
13
14
15
16
17
# File 'lib/opub/publisher.rb', line 11

def ping_hubs
  @hub_urls.each do |hub_url|
    res = Net::HTTP.post_form(URI.parse(hub_url),
                              { 'hub.mode' => 'publish',
                                'hub.url' => @topic_url })
  end
end