{ "schema_type": "object", "schema_version": "1.0", "name": "in_groups_of", "path": "packages/ree_array/package/ree_array/functions/in_groups_of.rb", "mount_as": "fn", "class": "ReeArray::InGroupsOf", "factory": null, "methods": [ { "doc": "Splits or iterates over the array in groups of size +number+,\npadding any remaining slots with +fill_with+ unless it is +false+.\n\n in_groups_of(%w(1 2 3 4 5 6 7 8 9 10), 3, fill_with: nil) {|group| p group}\n [\"1\", \"2\", \"3\"]\n [\"4\", \"5\", \"6\"]\n [\"7\", \"8\", \"9\"]\n [\"10\", nil, nil]\n\n in_groups_of(%w(1 2 3 4 5), 2, fill_with: ' ') {|group| p group}\n [\"1\", \"2\"]\n [\"3\", \"4\"]\n [\"5\", \" \"]\n\n in_groups_of(%w(1 2 3 4 5), 2) {|group| p group}\n [\"1\", \"2\"]\n [\"3\", \"4\"]\n [\"5\"]", "throws": [ "ArgumentError" ], "return": "Or[ArrayOf[Any], ArrayOf[ArrayOf[Any]]]", "args": [ { "arg": "array", "type": "ArrayOf[Any]" }, { "arg": "number", "type": "Integer" }, { "arg": "opts", "type": "Ksplat[:fill_with? => Any]" }, { "arg": "block", "type": "Block" } ] } ], "links": [ ] }