2 class SQL::Translator::Object with SQL::Translator::Object::Compat {
4 use MooseX::MultiMethods;
5 use MooseX::Types::Moose qw(Any ArrayRef HashRef Str);
11 _comments => 'elements',
12 add_comment => 'push',
13 remove_last_comment => 'pop',
15 default => sub { [] },
22 _options => 'elements',
24 remove_last_option => 'pop',
26 default => sub { [] },
34 exists_extra => 'exists',
36 get_extras => 'values',
40 default => sub { {} },
48 multi method comments(Str $comment) { $self->add_comment($comment); $self->comments }
49 multi method comments(ArrayRef $comments) { $self->add_comment($_) for @$comments; $self->comments }
50 multi method comments { wantarray ? $self->_comments : join "\n", $self->_comments }
52 multi method options(Str $option) { $self->add_option($option); $self->options }
53 multi method options(ArrayRef $options) { $self->add_option($_) for @$options; $self->options }
54 multi method options { wantarray ? $self->_options : $self->_options }
56 multi method extra(Str $extra) { $self->get_extra($extra) }
57 multi method extra(HashRef $extra) { $self->add_extra($_, $extra->{$_}) for keys %$extra; $self->extra }
58 multi method extra { wantarray ? %{$self->_extra} : $self->_extra }