Class: MiddlewareHealthcheck::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/middleware_healthcheck/configuration.rb

Constant Summary collapse

DEFAULT_HEALTHCHECK_PATH =
'/healthcheck'
DEFAULT_FULL_CHECK_PARAM_NAME =
'full'
DEFAULT_SELECTED_CHECK_PARAM_NAME =
'checks'
DEFAULT_ERROR_RESPONSE_STATUS =
422
DEFAULT_SUCCESS_RESPONSE_STATUS =
200
DEFAULT_SUCCESS_RESPONSE_BODY =
"It's alive!"
DEFAULT_ERRORS_DELIMITER =
'; '
DEFAULT_SELECTED_CHECK_PARAM_SPLIT_DELIMITER =
','

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/middleware_healthcheck/configuration.rb', line 18

def initialize
  self.healthcheck_path = DEFAULT_HEALTHCHECK_PATH
  self.full_check_param_name = DEFAULT_FULL_CHECK_PARAM_NAME
  self.selected_check_param_name = DEFAULT_SELECTED_CHECK_PARAM_NAME
  self.error_response_status = DEFAULT_ERROR_RESPONSE_STATUS
  self.success_response_status = DEFAULT_SUCCESS_RESPONSE_STATUS
  self.success_response_body = DEFAULT_SUCCESS_RESPONSE_BODY
  self.errors_delimiter = DEFAULT_ERRORS_DELIMITER
  self.selected_check_param_split_delimiter = DEFAULT_SELECTED_CHECK_PARAM_SPLIT_DELIMITER
  self.checkers = MiddlewareHealthcheck::DefaultCheckers.constants.map do |const|
    klass = MiddlewareHealthcheck::DefaultCheckers.const_get(const)
    klass if klass.is_a? Class
  end.compact
end

Instance Attribute Details

#checkersObject

Returns the value of attribute checkers.



14
15
16
# File 'lib/middleware_healthcheck/configuration.rb', line 14

def checkers
  @checkers
end

#error_response_statusObject

Returns the value of attribute error_response_status.



14
15
16
# File 'lib/middleware_healthcheck/configuration.rb', line 14

def error_response_status
  @error_response_status
end

#errors_delimiterObject

Returns the value of attribute errors_delimiter.



14
15
16
# File 'lib/middleware_healthcheck/configuration.rb', line 14

def errors_delimiter
  @errors_delimiter
end

#full_check_param_nameObject

Returns the value of attribute full_check_param_name.



14
15
16
# File 'lib/middleware_healthcheck/configuration.rb', line 14

def full_check_param_name
  @full_check_param_name
end

#healthcheck_pathObject

Returns the value of attribute healthcheck_path.



14
15
16
# File 'lib/middleware_healthcheck/configuration.rb', line 14

def healthcheck_path
  @healthcheck_path
end

#selected_check_param_nameObject

Returns the value of attribute selected_check_param_name.



14
15
16
# File 'lib/middleware_healthcheck/configuration.rb', line 14

def selected_check_param_name
  @selected_check_param_name
end

#selected_check_param_split_delimiterObject

Returns the value of attribute selected_check_param_split_delimiter.



14
15
16
# File 'lib/middleware_healthcheck/configuration.rb', line 14

def selected_check_param_split_delimiter
  @selected_check_param_split_delimiter
end

#success_response_bodyObject

Returns the value of attribute success_response_body.



14
15
16
# File 'lib/middleware_healthcheck/configuration.rb', line 14

def success_response_body
  @success_response_body
end

#success_response_statusObject

Returns the value of attribute success_response_status.



14
15
16
# File 'lib/middleware_healthcheck/configuration.rb', line 14

def success_response_status
  @success_response_status
end