Hi all,
I seem to be missing something wrt MooseX::AttributeHelpers::MethodProvider::ImmutableHash (and its derivatives). For a list, I can get the contents into an array using the provided 'elements' method: package Class; use Moose; use MooseX::AttributeHelpers; has 'values' => (isa => 'ArrayRef[Str]', metaclass => 'Collection::List', isa => 'ArrayRef[Str]', builder => '_build_values', provides => { 'elements' => 'all_values', # 'count' => 'count_values', # 'get => 'get_value', }, ); my @ary = $obj->all_values; However, the equivalent for a hash seems to be has 'options' => (is => 'ro', # strike 1: accessor isa => 'HashRef[Str]', metaclass => 'Collection::ImmutableHash, isa => 'HashRef[Str]', builder => '_build_options', provides => { 'keys' => 'all_option_keys', 'get => 'get_option', }, ); my %hsh = %{$obj->options}; # strike 2: dereference which is somewhat kludgier. And feels close to vanilla perl 5. I thought the 'kv' provided method would do this, but this seems to return an array of pairs, rather than a flat list. Am I missing something, or just picking nits, or is there an opportunity to slightly improve the API there? Cheers, -- Jurgen Pletinckx