The function returns a list
with every thing wrapped according the given type.
// Take as example:
my_set.map_wrap('_SomeType');
// This is a fast shortcut for:
my_set.map(|item| item.wrap('_SomeType'));
This function does not generate a change.
set.map_wrap([Type])
Argument | Arguments | Description |
---|---|---|
Type | str (optional) | Type’s name to wrap the thing with. If not given, the thing will be wrapped with its own type. |
A list
with the Ids for all the things in the original set.
This code shows an example using map_wrap(..):
set_type('_User', {name: 'str'});
users = [{name: "Iris", age: 9}];
// returns a list with wrapped things
users.map_wrap('_User');
Return value in JSON format
[
{
"name": "Iris"
}
]