Module: Mihari::Concerns::Configurable

Extended by:
ActiveSupport::Concern
Included in:
Actor
Defined in:
lib/mihari/concerns/configurable.rb

Overview

Configurable concern

Instance Method Summary collapse

Instance Method Details

#configuration_keys?Boolean

Check whether there are configuration key-values or not

Returns:

  • (Boolean)


16
17
18
19
20
# File 'lib/mihari/concerns/configurable.rb', line 16

def configuration_keys?
  return true if self.class.configuration_keys.empty?

  self.class.configuration_keys.all? { |key| Mihari.config.send(key) }
end

#configured?Boolean

Check whether it is configured or not

Returns:

  • (Boolean)


27
28
29
# File 'lib/mihari/concerns/configurable.rb', line 27

def configured?
  configuration_keys? || api_key?
end