module Eco module API class Session class Config class Apis module ServiceUp class << self def included(base) target_class = Eco::API::Session::Config::Apis msg = "To be included in #{target_class}. " msg << "Included in #{base}" raise msg unless base <= target_class super end end def service_up? @api_test ||= Session::Config::Api. api_class(active_api.version). new( 'foobar', host: active_api.host, logger: ::Logger.new(IO::NULL) ) status = @api_test.client.get('/policy_groups').status # 401 Unauthorized "Permission denied. API key may be invalid." status == 401 end end end end end end end