Class: Rubcask::Server::Config
- Inherits:
-
Struct
- Object
- Struct
- Rubcask::Server::Config
- Defined in:
- lib/rubcask/server/config.rb
Instance Attribute Summary collapse
-
#hostname ⇒ String
Hostname of the server.
-
#keepalive ⇒ boolean
Flag whether to set TCP’s keepalive.
-
#port ⇒ Integer
Port of the server.
-
#timeout ⇒ Integer
Timeut of the server.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize {|_self| ... } ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize {|_self| ... } ⇒ Config
Returns a new instance of Config.
17 18 19 20 21 22 23 24 |
# File 'lib/rubcask/server/config.rb', line 17 def initialize self.hostname = "localhost" self.timeout = nil self.keepalive = true self.port = 8080 yield(self) if block_given? end |
Instance Attribute Details
#hostname ⇒ String
Returns Hostname of the server.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/rubcask/server/config.rb', line 16 Config = Struct.new(:hostname, :port, :timeout, :keepalive) do def initialize self.hostname = "localhost" self.timeout = nil self.keepalive = true self.port = 8080 yield(self) if block_given? end def self.configure(&block) new(&block).freeze end end |
#keepalive ⇒ boolean
Returns Flag whether to set TCP’s keepalive.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/rubcask/server/config.rb', line 16 Config = Struct.new(:hostname, :port, :timeout, :keepalive) do def initialize self.hostname = "localhost" self.timeout = nil self.keepalive = true self.port = 8080 yield(self) if block_given? end def self.configure(&block) new(&block).freeze end end |
#port ⇒ Integer
Returns Port of the server.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/rubcask/server/config.rb', line 16 Config = Struct.new(:hostname, :port, :timeout, :keepalive) do def initialize self.hostname = "localhost" self.timeout = nil self.keepalive = true self.port = 8080 yield(self) if block_given? end def self.configure(&block) new(&block).freeze end end |
#timeout ⇒ Integer
Timeut of the server
If the client does not send any messages for provided number of seconds the connection with it s closed
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/rubcask/server/config.rb', line 16 Config = Struct.new(:hostname, :port, :timeout, :keepalive) do def initialize self.hostname = "localhost" self.timeout = nil self.keepalive = true self.port = 8080 yield(self) if block_given? end def self.configure(&block) new(&block).freeze end end |
Class Method Details
.configure(&block) ⇒ Object
26 27 28 |
# File 'lib/rubcask/server/config.rb', line 26 def self.configure(&block) new(&block).freeze end |