Class: Zas::ClientConfiguration
- Inherits:
-
Struct
- Object
- Struct
- Zas::ClientConfiguration
- Defined in:
- lib/zas/client_configuration.rb
Overview
Public: Struct used to configure the Zas::Client. Configuration options are:
host - The IP address of the service (default: 127.0.0.1) port - The port number for the service (default: 5555) name - The name of the client for logging (default: zas-client)
timeout - The timeout, in seconds, to wait for a response from the service (default: 1 second) logger - The logger (default: syslog)
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#name ⇒ Object
Returns the value of attribute name.
-
#port ⇒ Object
Returns the value of attribute port.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ ClientConfiguration
constructor
Public: Construct the ClientConfiguration.
Constructor Details
#initialize(attributes = {}) ⇒ ClientConfiguration
Public: Construct the ClientConfiguration.
attributes - A Hash of attributes. All attributes are optional:
host - The IP address of the service (default: 127.0.0.1)
port - The port number for the service (default: 5555)
name - The name of the client for logging (default: zas-client)
timeout - The timeout, in seconds, to wait for a response from the service (default: 1 second)
logger - The logger (default: syslog)
18 19 20 21 22 |
# File 'lib/zas/client_configuration.rb', line 18 def initialize(attributes={}) attributes.each do |k, v| self[k] = v end end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host
9 10 11 |
# File 'lib/zas/client_configuration.rb', line 9 def host @host end |
#logger ⇒ Object
Returns the value of attribute logger
9 10 11 |
# File 'lib/zas/client_configuration.rb', line 9 def logger @logger end |
#name ⇒ Object
Returns the value of attribute name
9 10 11 |
# File 'lib/zas/client_configuration.rb', line 9 def name @name end |
#port ⇒ Object
Returns the value of attribute port
9 10 11 |
# File 'lib/zas/client_configuration.rb', line 9 def port @port end |
#timeout ⇒ Object
Returns the value of attribute timeout
9 10 11 |
# File 'lib/zas/client_configuration.rb', line 9 def timeout @timeout end |