Sha256: bf0e13141b15a214407052a3cb8b71b24805c8277d0112bdfc6daa5ecefe9b51
Contents?: true
Size: 976 Bytes
Versions: 12
Compression:
Stored size: 976 Bytes
Contents
require_relative 'base' module Swaggard module Swagger module Parameters class Form < Base def initialize(string) @in = 'formData' parse(string) end private # Example: [Array] status Filter by status. (e.g. status[]=1&status[]=2&status[]=3) # Example: [Array] status(required) Filter by status. (e.g. status[]=1&status[]=2&status[]=3) # Example: [Integer] media[media_type_id] ID of the desired media type. def parse(string) data_type, name, required, description = string.match(/\A\[(\w*)\]\s*([\w\[\]]*)(\(required\))?\s*(.*)\Z/).captures allow_multiple = name.gsub!('[]', '') @name = name @description = description @data_type = data_type.downcase @is_required = required.present? @allow_multiple = allow_multiple.present? end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems