Sha256: a4bd79112b4c53352946d699d12ae87a245fe99336c1c432bddc5ec223d43d01

Contents?: true

Size: 315 Bytes

Versions: 4

Compression:

Stored size: 315 Bytes

Contents

class Fwd::Backend
  attr_reader :url

  def initialize(url)
    @url = URI(url)
  end

  def write(data)
    sock.write(data)
  end

  def close
    @sock.close if @sock
    @sock = nil
  end

  def to_s
    url.to_s
  end

  protected

    def sock
      @sock ||= TCPSocket.new @url.host, @url.port
    end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fwd-0.3.3 lib/fwd/backend.rb
fwd-0.3.2 lib/fwd/backend.rb
fwd-0.3.1 lib/fwd/backend.rb
fwd-0.3.0 lib/fwd/backend.rb