Module: SmartCore::Schema::KeyControl Private
- Defined in:
- lib/smart_core/schema/key_control.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Class Method Summary collapse
- .normalize(key) ⇒ String private
- .normalize_list(keys) ⇒ Array<String> private
- .prevent_incompatible!(key) ⇒ void private
Class Method Details
.normalize(key) ⇒ String
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.
12 13 14 15 |
# File 'lib/smart_core/schema/key_control.rb', line 12 def normalize(key) prevent_incompatible!(key) key.to_s end |
.normalize_list(keys) ⇒ Array<String>
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.
22 23 24 |
# File 'lib/smart_core/schema/key_control.rb', line 22 def normalize_list(keys) keys.map { |key| normalize(key) } end |
.prevent_incompatible!(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.
31 32 33 34 35 36 37 |
# File 'lib/smart_core/schema/key_control.rb', line 31 def prevent_incompatible!(key) unless key.is_a?(String) || key.is_a?(Symbol) raise(SmartCore::Schema::ArgumentError, <<~ERROR_MESSAGE) Schema keys should be a type of string or symbol ERROR_MESSAGE end end |