Class: CryptReboot::LazyConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/crypt_reboot/lazy_config.rb

Overview

Return getter lambdas instead of configuration settings directly

Class Method Summary collapse

Class Method Details

.instanceObject



17
18
19
# File 'lib/crypt_reboot/lazy_config.rb', line 17

def instance
  Config.instance
end

.method_missing(method_name, *args, **kwargs, &block) ⇒ Object



7
8
9
10
11
# File 'lib/crypt_reboot/lazy_config.rb', line 7

def method_missing(method_name, *args, **kwargs, &block)
  return super unless instance.respond_to?(method_name)

  -> { instance.send(method_name, *args, **kwargs, &block) }
end

.respond_to_missing?(name, *_, **_) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/crypt_reboot/lazy_config.rb', line 13

def respond_to_missing?(name, *_, **_)
  instance.respond_to?(name)
end