Class: Soter::Config

Inherits:
Struct
  • Object
show all
Defined in:
lib/soter/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#attemptsObject

Returns the value of attribute attempts

Returns:

  • (Object)

    the current value of attempts



2
3
4
# File 'lib/soter/config.rb', line 2

def attempts
  @attempts
end

#dbObject

Returns the value of attribute db

Returns:

  • (Object)

    the current value of db



2
3
4
# File 'lib/soter/config.rb', line 2

def db
  @db
end

#forkObject

Returns the value of attribute fork

Returns:

  • (Object)

    the current value of fork



2
3
4
# File 'lib/soter/config.rb', line 2

def fork
  @fork
end

#hostObject

Returns the value of attribute host

Returns:

  • (Object)

    the current value of host



2
3
4
# File 'lib/soter/config.rb', line 2

def host
  @host
end

#hostsObject

Returns the value of attribute hosts

Returns:

  • (Object)

    the current value of hosts



2
3
4
# File 'lib/soter/config.rb', line 2

def hosts
  @hosts
end

#logfileObject

Returns the value of attribute logfile

Returns:

  • (Object)

    the current value of logfile



2
3
4
# File 'lib/soter/config.rb', line 2

def logfile
  @logfile
end

#loggerObject

Returns the value of attribute logger

Returns:

  • (Object)

    the current value of logger



2
3
4
# File 'lib/soter/config.rb', line 2

def logger
  @logger
end

#portObject

Returns the value of attribute port

Returns:

  • (Object)

    the current value of port



2
3
4
# File 'lib/soter/config.rb', line 2

def port
  @port
end

#workersObject

Returns the value of attribute workers

Returns:

  • (Object)

    the current value of workers



2
3
4
# File 'lib/soter/config.rb', line 2

def workers
  @workers
end

Instance Method Details

#queue_settingsObject



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/soter/config.rb', line 5

def queue_settings
  host_settings = host ? {host: host} : {hosts: hosts}

  host_settings.merge({
    port:       port,
    database:   db,
    collection: "soter_queue",
    timeout:    300,
    attempts:   (attempts || 3)
  })
end