Module: ImageKitIo::Utils::OptionValidator
- Includes:
- Constantable, Formatter
- Included in:
- ApiService::CustomMetadataField, ApiService::File
- Defined in:
- lib/imagekitio/utils/option_validator.rb
Class Method Summary collapse
Methods included from Constantable
Methods included from Formatter
camel_to_snake, format_to_json, request_formatter, snake_to_camel
Class Method Details
.validate_upload_options(options) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/imagekitio/utils/option_validator.rb', line 11 def () # Validates upload value, checks if params are valid, # changes snake to camel case which is supported by # ImageKitIo server response_list = [] .each do |key, val| if constants.VALID_UPLOAD_OPTIONS.include?(key.to_s) if val.is_a?(Array) val = val.join(",") end if val.is_a?(TrueClass) || val.is_a?(FalseClass) val = val.to_s end [key] = val else return false end end request_formatter() end |