Class: HealthMonitor::Providers::Base
- Inherits:
-
Object
- Object
- HealthMonitor::Providers::Base
- Defined in:
- lib/health_monitor/providers/base.rb
Instance Attribute Summary collapse
-
#configuration ⇒ Object
Returns the value of attribute configuration.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Class Method Summary collapse
- .configurable? ⇒ Boolean
- .configuration_class ⇒ Object abstract
- .configure {|@global_configuration| ... } ⇒ Object
- .provider_name ⇒ Object
Instance Method Summary collapse
- #check! ⇒ Object abstract
-
#initialize(request: nil) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(request: nil) ⇒ Base
Returns a new instance of Base.
19 20 21 22 23 24 |
# File 'lib/health_monitor/providers/base.rb', line 19 def initialize(request: nil) @request = request return unless self.class.configurable? self.configuration = self.class.instance_variable_get('@global_configuration') end |
Instance Attribute Details
#configuration ⇒ Object
Returns the value of attribute configuration.
5 6 7 |
# File 'lib/health_monitor/providers/base.rb', line 5 def configuration @configuration end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
4 5 6 |
# File 'lib/health_monitor/providers/base.rb', line 4 def request @request end |
Class Method Details
.configurable? ⇒ Boolean
31 32 33 |
# File 'lib/health_monitor/providers/base.rb', line 31 def self.configurable? configuration_class end |
.configuration_class ⇒ Object
This method is abstract.
36 |
# File 'lib/health_monitor/providers/base.rb', line 36 def self.configuration_class; end |
.configure {|@global_configuration| ... } ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/health_monitor/providers/base.rb', line 11 def self.configure return unless configurable? @global_configuration = configuration_class.new yield @global_configuration if block_given? end |
.provider_name ⇒ Object
7 8 9 |
# File 'lib/health_monitor/providers/base.rb', line 7 def self.provider_name @name ||= name.demodulize end |
Instance Method Details
#check! ⇒ Object
This method is abstract.
27 28 29 |
# File 'lib/health_monitor/providers/base.rb', line 27 def check! raise NotImplementedError end |