Module: AnyVali::CoercionConfig
- Defined in:
- lib/anyvali/parse/coercion_config.rb
Constant Summary collapse
- PORTABLE_COERCIONS =
%w[ string string->int string->number string->bool trim lower upper ].freeze
Class Method Summary collapse
Class Method Details
.portable?(config) ⇒ Boolean
15 16 17 18 |
# File 'lib/anyvali/parse/coercion_config.rb', line 15 def self.portable?(config) configs = config.is_a?(Array) ? config : [config] configs.all? { |c| PORTABLE_COERCIONS.include?(c) } end |