1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
use strict;
use warnings;
my @element = (
# Value constructor args are passed in their specific array ref
cargo_type => 'leaf',
cargo_args => { value_type => 'string' },
);
return [
[
name => "MasterModel::HashIdOfValues",
element => [
plain_hash => {
type => 'hash',
# hash_class constructor args are all keys of this hash
# except type and class
index_type => 'integer',
@element
},
hash_with_auto_created_id => {
type => 'hash',
index_type => 'string',
auto_create => 'yada',
@element
},
hash_with_several_auto_created_id => {
type => 'hash',
index_type => 'string',
auto_create => [qw/x y z/],
@element
},
[qw/hash_with_default_id hash_with_default_id_2/] => {
type => 'hash',
index_type => 'string',
default => 'yada',
@element
},
hash_with_several_default_keys => {
type => 'hash',
index_type => 'string',
default => [qw/x y z/],
@element
},
hash_follower => {
type => 'hash',
index_type => 'string',
@element,
follow_keys_from => '- hash_with_several_auto_created_id',
},
hash_with_allow => {
type => 'hash',
index_type => 'string',
@element,
allow_keys => [qw/foo bar baz/],
},
hash_with_allow_from => {
type => 'hash',
index_type => 'string',
@element,
allow_keys_from => '- hash_with_several_auto_created_id',
},
ordered_hash => {
type => 'hash',
index_type => 'string',
@element,
ordered => 1,
},
],
]
];
|