Sha256: 442aa50da5c3433921136da53ee8d3cdb290a9ba0aa67781971ca3ba4b837b5e

Contents?: true

Size: 358 Bytes

Versions: 1

Compression:

Stored size: 358 Bytes

Contents

require "socket"
require "json"

module Healthety
  class Transmission
    def initialize(host, port)
      @host = host
      @port = port
      @socket = UDPSocket.new
    end

    def send(name, value)
      data = {:name => name, :value => value}.to_json
      @socket.send(data, 0, @host, @port)
      $stdout << "#{name}: #{value}\n"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
healthety-0.0.1 lib/healthety/transmission.rb