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.
30 31 32 |
# File 'lib/qonfig/settings/key_guard.rb', line 30 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.
24 25 26 |
# File 'lib/qonfig/settings/key_guard.rb', line 24 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.
15 16 17 |
# File 'lib/qonfig/settings/key_guard.rb', line 15 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.
65 66 67 68 69 70 |
# File 'lib/qonfig/settings/key_guard.rb', line 65 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.
41 42 43 44 |
# File 'lib/qonfig/settings/key_guard.rb', line 41 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.
52 53 54 55 56 57 |
# File 'lib/qonfig/settings/key_guard.rb', line 52 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 |