Class: Failbot::JSONBackend
- Inherits:
-
Object
- Object
- Failbot::JSONBackend
- Defined in:
- lib/failbot/json_backend.rb
Instance Method Summary collapse
-
#initialize(host, port) ⇒ JSONBackend
constructor
A new instance of JSONBackend.
- #report(data) ⇒ Object
- #reports ⇒ Object
Constructor Details
#initialize(host, port) ⇒ JSONBackend
Returns a new instance of JSONBackend.
5 6 7 8 |
# File 'lib/failbot/json_backend.rb', line 5 def initialize(host, port) @host = host @port = port end |
Instance Method Details
#report(data) ⇒ Object
10 11 12 13 14 |
# File 'lib/failbot/json_backend.rb', line 10 def report(data) @socket = TCPSocket.new @host, @port @socket.send(data.to_json, 0) @socket.close end |
#reports ⇒ Object
16 17 18 |
# File 'lib/failbot/json_backend.rb', line 16 def reports raise NotImplementedError end |