Class: TCPClient::Configuration
- Inherits:
-
Object
- Object
- TCPClient::Configuration
- Defined in:
- lib/tcp-client/configuration.rb
Instance Attribute Summary collapse
-
#buffered ⇒ Object
Returns the value of attribute buffered.
-
#keep_alive ⇒ Object
Returns the value of attribute keep_alive.
-
#reverse_lookup ⇒ Object
Returns the value of attribute reverse_lookup.
-
#ssl_params ⇒ Object
Returns the value of attribute ssl_params.
Class Method Summary collapse
Instance Method Summary collapse
- #connect_timeout ⇒ Object
- #connect_timeout=(seconds) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #read_timeout ⇒ Object
- #read_timeout=(seconds) ⇒ Object
- #ssl=(yn) ⇒ Object
- #ssl? ⇒ Boolean
- #timeout=(seconds) ⇒ Object
- #write_timeout ⇒ Object
- #write_timeout=(seconds) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
12 13 14 15 |
# File 'lib/tcp-client/configuration.rb', line 12 def initialize @buffered = @keep_alive = @reverse_lookup = true self.timeout = @ssl_params = nil end |
Instance Attribute Details
#buffered ⇒ Object
Returns the value of attribute buffered.
9 10 11 |
# File 'lib/tcp-client/configuration.rb', line 9 def buffered @buffered end |
#keep_alive ⇒ Object
Returns the value of attribute keep_alive.
9 10 11 |
# File 'lib/tcp-client/configuration.rb', line 9 def keep_alive @keep_alive end |
#reverse_lookup ⇒ Object
Returns the value of attribute reverse_lookup.
9 10 11 |
# File 'lib/tcp-client/configuration.rb', line 9 def reverse_lookup @reverse_lookup end |
#ssl_params ⇒ Object
Returns the value of attribute ssl_params.
10 11 12 |
# File 'lib/tcp-client/configuration.rb', line 10 def ssl_params @ssl_params end |
Class Method Details
.create {|ret| ... } ⇒ Object
3 4 5 6 7 |
# File 'lib/tcp-client/configuration.rb', line 3 def self.create ret = new yield(ret) if block_given? ret end |
Instance Method Details
#connect_timeout ⇒ Object
44 45 46 |
# File 'lib/tcp-client/configuration.rb', line 44 def connect_timeout @connect_timeout || @timeout end |
#connect_timeout=(seconds) ⇒ Object
48 49 50 |
# File 'lib/tcp-client/configuration.rb', line 48 def connect_timeout=(seconds) @connect_timeout = seconds(seconds) end |
#read_timeout ⇒ Object
60 61 62 |
# File 'lib/tcp-client/configuration.rb', line 60 def read_timeout @read_timeout || @timeout end |
#read_timeout=(seconds) ⇒ Object
64 65 66 |
# File 'lib/tcp-client/configuration.rb', line 64 def read_timeout=(seconds) @read_timeout = seconds(seconds) end |
#ssl=(yn) ⇒ Object
21 22 23 24 25 |
# File 'lib/tcp-client/configuration.rb', line 21 def ssl=(yn) return @ssl_params = nil unless yn return @ssl_params = yn if Hash === yn @ssl_params ||= {} end |
#ssl? ⇒ Boolean
17 18 19 |
# File 'lib/tcp-client/configuration.rb', line 17 def ssl? @ssl_params ? true : false end |
#timeout=(seconds) ⇒ Object
39 40 41 42 |
# File 'lib/tcp-client/configuration.rb', line 39 def timeout=(seconds) @timeout = seconds(seconds) @connect_timeout = @write_timeout = @read_timeout = nil end |
#write_timeout ⇒ Object
52 53 54 |
# File 'lib/tcp-client/configuration.rb', line 52 def write_timeout @write_timeout || @timeout end |
#write_timeout=(seconds) ⇒ Object
56 57 58 |
# File 'lib/tcp-client/configuration.rb', line 56 def write_timeout=(seconds) @write_timeout = seconds(seconds) end |