Class: DNSRecordUpdater::NotificationService
- Inherits:
-
Object
- Object
- DNSRecordUpdater::NotificationService
- Defined in:
- lib/dns_record_updater/notification_service.rb
Instance Method Summary collapse
-
#initialize(endpoints) ⇒ NotificationService
constructor
A new instance of NotificationService.
- #notify(message) ⇒ Object
Constructor Details
#initialize(endpoints) ⇒ NotificationService
Returns a new instance of NotificationService.
5 6 7 |
# File 'lib/dns_record_updater/notification_service.rb', line 5 def initialize(endpoints) @endpoints = endpoints end |
Instance Method Details
#notify(message) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/dns_record_updater/notification_service.rb', line 9 def notify() @endpoints.each do |uri| payload = { content: }.to_json Net::HTTP.post(URI(uri), payload, { "Content-Type" => "application/json" }) end end |