Add support for Ruby keyword arguments
Ruby keyword arguments are represented differently than positional arguments in the MaD format: they are represented as `Method[key:]`. The framework endpoints query also returns the name as `key:`, so we can detect these and format them as such.
This commit is contained in:
@@ -160,10 +160,19 @@ export const ruby: ModelsAsDataLanguage = {
|
||||
},
|
||||
getArgumentOptions: (method) => {
|
||||
const argumentsList = getArgumentsList(method.methodParameters).map(
|
||||
(argument, index): MethodArgument => ({
|
||||
path: `Argument[${index}]`,
|
||||
label: `Argument[${index}]: ${argument}`,
|
||||
}),
|
||||
(argument, index): MethodArgument => {
|
||||
if (argument.endsWith(":")) {
|
||||
return {
|
||||
path: `Argument[${argument}]`,
|
||||
label: `Argument[${argument}]`,
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
path: `Argument[${index}]`,
|
||||
label: `Argument[${index}]: ${argument}`,
|
||||
};
|
||||
},
|
||||
);
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user