Class: Tox::Proxies::Base Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/tox/proxies/base.rb

Overview

This class is abstract.

Base class for proxy used to connect to TCP relays.

Direct Known Subclasses

HTTP, SOCKS5

Constant Summary collapse

HOST_MAX_BYTESIZE =
255
PORT_RANGE =
1..65_535

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host, port) ⇒ Base

Returns a new instance of Base.



15
16
17
18
# File 'lib/tox/proxies/base.rb', line 15

def initialize(host, port)
  self.host = host
  self.port = port
end

Instance Attribute Details

#hostObject

Returns the value of attribute host.



13
14
15
# File 'lib/tox/proxies/base.rb', line 13

def host
  @host
end

#portObject

Returns the value of attribute port.



13
14
15
# File 'lib/tox/proxies/base.rb', line 13

def port
  @port
end

Instance Method Details

#==(other) ⇒ Object



24
25
26
27
28
# File 'lib/tox/proxies/base.rb', line 24

def ==(other)
  self.class == other.class &&
    host == other.host &&
    port == other.port
end

#typeObject

Raises:

  • (NotImplementedError)


20
21
22
# File 'lib/tox/proxies/base.rb', line 20

def type
  raise NotImplementedError, "#{self.class}#type"
end