Sha256: 0e6b8e4bf06e22022a425622f1de1eee8e83ecb8aa63e2bcc62343524c027778

Contents?: true

Size: 460 Bytes

Versions: 11

Compression:

Stored size: 460 Bytes

Contents

# frozen_string_literal: true

module Mihari
  module Configurable
    def configured?
      config_keys.all? { |key| Mihari.config.send(key) }
    end

    def configuration_status
      return nil if config_keys.empty?

      names = config_keys.join(" and ")
      be_verb = config_keys.length == 1 ? "is" : "are"
      status = configured? ? "found" : "missing"
      "#{names} #{be_verb} #{status}"
    end

    def config_keys
      []
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
mihari-1.5.1 lib/mihari/configurable.rb
mihari-1.5.0 lib/mihari/configurable.rb
mihari-1.4.1 lib/mihari/configurable.rb
mihari-1.4.0 lib/mihari/configurable.rb
mihari-1.3.2 lib/mihari/configurable.rb
mihari-1.3.1 lib/mihari/configurable.rb
mihari-1.3.0 lib/mihari/configurable.rb
mihari-1.2.1 lib/mihari/configurable.rb
mihari-1.2.0 lib/mihari/configurable.rb
mihari-1.1.1 lib/mihari/configurable.rb
mihari-1.1.0 lib/mihari/configurable.rb