Class: HealthCheckToolbox::Config
- Inherits:
-
Object
- Object
- HealthCheckToolbox::Config
show all
- Defined in:
- lib/health_check_toolbox/config.rb
Constant Summary
collapse
- STATIC =
%w[redis database wso2 rest_services].freeze
- SERVICE =
'_service'
Class Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/health_check_toolbox/config.rb', line 22
def method_missing(method, *args, &block)
method_name = method.to_s
if respond_to_missing?(method_name)
config_class =
"HealthCheckToolbox::Services::#{method_name.camelize}".constantize
service = config_class.new(args, block)
self.class.add_service(service)
else
super
end
end
|
Class Attribute Details
.services ⇒ Object
Returns the value of attribute services.
11
12
13
|
# File 'lib/health_check_toolbox/config.rb', line 11
def services
@services
end
|
Class Method Details
.add_service(service) ⇒ Object
13
14
15
|
# File 'lib/health_check_toolbox/config.rb', line 13
def add_service(service)
services.push(service)
end
|
.services_status ⇒ Object
Instance Method Details
#respond_to_missing?(method_name) ⇒ Boolean
35
36
37
|
# File 'lib/health_check_toolbox/config.rb', line 35
def respond_to_missing?(method_name)
STATIC.include?(method_name.to_s) || method_name.include?(SERVICE)
end
|