Class: DNS::Monitor::GChat
- Inherits:
-
Object
- Object
- DNS::Monitor::GChat
- Defined in:
- lib/dns/monitor/gchat.rb
Instance Method Summary collapse
-
#initialize(webhook_url) ⇒ GChat
constructor
A new instance of GChat.
- #message(text) ⇒ Object
Constructor Details
#initialize(webhook_url) ⇒ GChat
Returns a new instance of GChat.
4 5 6 |
# File 'lib/dns/monitor/gchat.rb', line 4 def initialize(webhook_url) @webhook_url = webhook_url end |
Instance Method Details
#message(text) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/dns/monitor/gchat.rb', line 8 def (text) Net::HTTP.post( URI(@webhook_url), {text: text}.to_json, 'Content-Type' => 'application/json' ) end |