Module: Servus::Support::Lockdown::ClassMethods

Defined in:
lib/servus/support/lockdown.rb

Overview

Class-level helpers installed on Base.

Instance Method Summary collapse

Instance Method Details

#apply_lockdown!void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Applies Config#lockdown_enabled to ‘.new`’s visibility. Called on include and re-called whenever the config flag changes.



84
85
86
87
88
89
90
# File 'lib/servus/support/lockdown.rb', line 84

def apply_lockdown!
  if Servus.config.lockdown_enabled
    singleton_class.send(:private, :new)
  else
    singleton_class.send(:public, :new)
  end
end