Class: Tox::Options
- Inherits:
-
Object
- Object
- Tox::Options
- Defined in:
- lib/tox/options.rb
Overview
Startup options for Tox client.
Constant Summary collapse
- BIND_PORT_RANGE =
0..65_535
Instance Attribute Summary collapse
-
#proxy ⇒ Object
Returns the value of attribute proxy.
Instance Method Summary collapse
- #end_port=(value) ⇒ Object
- #set_proxy_params(type, host, port) ⇒ Object private
- #start_port=(value) ⇒ Object
- #tcp_port=(value) ⇒ Object
Instance Attribute Details
#proxy ⇒ Object
Returns the value of attribute proxy.
10 11 12 |
# File 'lib/tox/options.rb', line 10 def proxy @proxy end |
Instance Method Details
#end_port=(value) ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/tox/options.rb', line 35 def end_port=(value) unless value.is_a? Integer raise TypeError, "Expected #{Integer}, got #{value.class}" end unless BIND_PORT_RANGE.include? value raise "Expected value to be from range #{BIND_PORT_RANGE}" end self.end_port_internal = value end |
#set_proxy_params(type, host, port) ⇒ Object (private)
57 58 59 60 61 |
# File 'lib/tox/options.rb', line 57 def set_proxy_params(type, host, port) self.proxy_type = type self.proxy_host = host self.proxy_port = port end |
#start_port=(value) ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/tox/options.rb', line 25 def start_port=(value) unless value.is_a? Integer raise TypeError, "Expected #{Integer}, got #{value.class}" end unless BIND_PORT_RANGE.include? value raise "Expected value to be from range #{BIND_PORT_RANGE}" end self.start_port_internal = value end |
#tcp_port=(value) ⇒ Object
45 46 47 48 49 50 51 52 53 |
# File 'lib/tox/options.rb', line 45 def tcp_port=(value) unless value.is_a? Integer raise TypeError, "Expected #{Integer}, got #{value.class}" end unless BIND_PORT_RANGE.include? value raise "Expected value to be from range #{BIND_PORT_RANGE}" end self.tcp_port_internal = value end |