Module: Kitchen::Terraform::ConfigPredicates::HashOfSymbolsAndStrings
- Includes:
- Dry::Logic::Predicates
- Defined in:
- lib/kitchen/terraform/config_predicates/hash_of_symbols_and_strings.rb
Overview
Behaviour to provide a configuration attribute predicate for a hash including only symbol keys and string values.
This module must be declared as providing predicates and extended in a schema’s configuration in order to be used.
Class Method Summary collapse
-
.all_strings?(values:) ⇒ ::TrueClass, ::FalseClass
private
If all values are strings then the result is
true; else the result isfalse. -
.all_symbols?(keys:) ⇒ ::TrueClass, ::FalseClass
private
If all keys are symbols then the result is
true; else the result isfalse.
Class Method Details
.all_strings?(values:) ⇒ ::TrueClass, ::FalseClass
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.
If all values are strings then the result is true; else the result is false.
53 54 55 56 57 58 |
# File 'lib/kitchen/terraform/config_predicates/hash_of_symbols_and_strings.rb', line 53 def self.all_strings?(values:) values .all? do |value| value.kind_of? ::String end end |
.all_symbols?(keys:) ⇒ ::TrueClass, ::FalseClass
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.
If all keys are symbols then the result is true; else the result is false.
41 42 43 44 45 46 |
# File 'lib/kitchen/terraform/config_predicates/hash_of_symbols_and_strings.rb', line 41 def self.all_symbols?(keys:) keys .all? do |key| key.kind_of? ::Symbol end end |