| 1 | package Net::Zuora::ZObject::MetaClassRole; | ||
| 2 | use Moose::Role; | ||
| 3 | use namespace::autoclean; | ||
| 4 | |||
| 5 | use Data::Dumper; | ||
| 6 | around get_all_attributes => sub { | ||
| 7 | my ($orig, $self, @rest) = @_; | ||
| 8 | sort { | ||
| 9 | my ($a_idx, $b_idx) = ($a->can('index') ? $a->index||0 : 0, | ||
| 10 | $b->can('index') ? $b->index||0 : 0 ); | ||
| 11 | $a_idx <=> $b_idx; | ||
| 12 | } $self->$orig(@rest); | ||
| 13 | }; | ||
| 14 | |||
| 15 | 1; | ||
| 16 |