Class: Zas::ClientConfiguration

Inherits:
Struct
  • Object
show all
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

Instance Method Summary collapse

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

#hostObject

Returns the value of attribute host

Returns:

  • (Object)

    the current value of host



9
10
11
# File 'lib/zas/client_configuration.rb', line 9

def host
  @host
end

#loggerObject

Returns the value of attribute logger

Returns:

  • (Object)

    the current value of logger



9
10
11
# File 'lib/zas/client_configuration.rb', line 9

def logger
  @logger
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



9
10
11
# File 'lib/zas/client_configuration.rb', line 9

def name
  @name
end

#portObject

Returns the value of attribute port

Returns:

  • (Object)

    the current value of port



9
10
11
# File 'lib/zas/client_configuration.rb', line 9

def port
  @port
end

#timeoutObject

Returns the value of attribute timeout

Returns:

  • (Object)

    the current value of timeout



9
10
11
# File 'lib/zas/client_configuration.rb', line 9

def timeout
  @timeout
end