Class: OStatus2::Publication
- Inherits:
-
Object
- Object
- OStatus2::Publication
- Defined in:
- lib/ostatus2/publication.rb
Instance Method Summary collapse
-
#initialize(url, hubs = []) ⇒ Publication
constructor
A new instance of Publication.
-
#publish ⇒ Object
Notifies hubs about the update to the topic URL.
Constructor Details
#initialize(url, hubs = []) ⇒ Publication
Returns a new instance of Publication.
5 6 7 8 |
# File 'lib/ostatus2/publication.rb', line 5 def initialize(url, hubs = []) @url = url @hubs = hubs.map { |hub_url| Addressable::URI.parse(hub_url) } end |
Instance Method Details
#publish ⇒ Object
Notifies hubs about the update to the topic URL
13 14 15 |
# File 'lib/ostatus2/publication.rb', line 13 def publish @hubs.each { |hub| http_client.post(hub, form: { 'hub.mode' => 'publish', 'hub.url' => @url }) } end |