Class: Qonfig::Settings::KeyGuard Private
- Inherits:
-
Object
- Object
- Qonfig::Settings::KeyGuard
- Defined in:
- lib/qonfig/settings/key_guard.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #key ⇒ String, ... readonly private
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(key) ⇒ KeyGuard
constructor
private
A new instance of KeyGuard.
- #prevent_core_method_intersection! ⇒ void private
- #prevent_incomparabilities! ⇒ void private
- #prevent_incompatible_key_type! ⇒ void private
Constructor Details
#initialize(key) ⇒ KeyGuard
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.
Returns a new instance of KeyGuard.
32 33 34 |
# File 'lib/qonfig/settings/key_guard.rb', line 32 def initialize(key) @key = key end |
Instance Attribute Details
#key ⇒ String, ... (readonly)
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.
26 27 28 |
# File 'lib/qonfig/settings/key_guard.rb', line 26 def key @key end |
Class Method Details
.prevent_incomparabilities!(key) ⇒ 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.
17 18 19 |
# File 'lib/qonfig/settings/key_guard.rb', line 17 def prevent_incomparabilities!(key) new(key).prevent_incomparabilities! end |
Instance Method Details
#prevent_core_method_intersection! ⇒ 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.
67 68 69 70 71 72 |
# File 'lib/qonfig/settings/key_guard.rb', line 67 def prevent_core_method_intersection! raise( Qonfig::CoreMethodIntersectionError, "<#{key}> key can not be used since this is a private core method" ) if Qonfig::Settings::CORE_METHODS.include?(key.to_s) end |
#prevent_incomparabilities! ⇒ 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.
43 44 45 46 |
# File 'lib/qonfig/settings/key_guard.rb', line 43 def prevent_incomparabilities! prevent_incompatible_key_type! prevent_core_method_intersection! end |
#prevent_incompatible_key_type! ⇒ 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.
54 55 56 57 58 59 |
# File 'lib/qonfig/settings/key_guard.rb', line 54 def prevent_incompatible_key_type! raise( Qonfig::ArgumentError, 'Setting key should be a symbol or a string!' ) unless key.is_a?(Symbol) || key.is_a?(String) end |