We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0b4110f commit bb38addCopy full SHA for bb38add
lib/Examples/Categories.pm
@@ -16,16 +16,16 @@ class Categories is export {
16
has %.categories;
17
18
submethod TWEAK {
19
- for %!categories-table.keys -> $category-key {
20
- %!categories{$category-key} = Category.new(
21
- key => $category-key,
22
- title => %!categories-table{$category-key},
+ for %!categories-table.kv -> $key, $title {
+ %!categories{$key} = Category.new(
+ :$key,
+ :$title,
23
);
24
}
25
26
27
method categories-list {
28
- return %!categories.values;
+ return %!categories.pairs.sort.map(*.value);
29
30
31
method append-subcategories(:$to-category, :$subcategories) {
0 commit comments