Skip to content

Commit

Permalink
Coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
n-rodriguez committed Mar 13, 2019
1 parent 2a87f4e commit 7c4cf10
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions lib/health_monitor/providers/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,46 @@
module HealthMonitor
module Providers
class Base
attr_reader :request

attr_reader :request
attr_accessor :configuration

def self.provider_name
@provider_name ||= name.demodulize
def initialize(request: nil)
@request = request

return unless self.class.configurable?

self.configuration = self.class.instance_variable_get('@global_configuration')
end

def self.configure
return unless configurable?
class << self

@global_configuration = configuration_class.new
def provider_name
@provider_name ||= name.demodulize
end

yield @global_configuration if block_given?
end
def configure
return unless configurable?

def initialize(request: nil)
@request = request
@global_configuration = configuration_class.new

return unless self.class.configurable?
yield @global_configuration if block_given?
end

def configurable?
configuration_class
end

def configuration_class
end

self.configuration = self.class.instance_variable_get('@global_configuration')
end

# @abstract
def check!
raise NotImplementedError
end

def self.configurable?
configuration_class
end

# @abstract
def self.configuration_class; end
end
end
end

0 comments on commit 7c4cf10

Please sign in to comment.