2 class SQL::Translator::Object {
4 use MooseX::MultiMethods;
5 use MooseX::Types::Moose qw(Any ArrayRef HashRef Str);
12 add_comment => 'push',
13 remove_last_comment => 'pop',
15 default => sub { [] },
25 remove_last_option => 'pop',
27 default => sub { [] },
36 exists_extra => 'exists',
38 get_extras => 'values',
42 default => sub { {} },
46 multi method comments(Str $comment) { $self->add_comment($comment); $self->comments }
47 multi method comments(ArrayRef $comments) { $self->add_comment($_) for @$comments; $self->comments }
48 multi method comments(Any $) { wantarray ? @{$self->_comments} : join "\n", $self->_comments }
50 multi method options(Str $option) { $self->add_option($option); $self->options }
51 multi method options(ArrayRef $options) { $self->add_option($_) for @$options; $self->options }
52 multi method options(Any $) { wantarray ? @{$self->_options} : $self->_options }
54 multi method extra(Str $extra) { $self->get_extra($extra) }
55 multi method extra(HashRef $extra) { $self->add_extra($_, $extra->{$_}) for keys %$extra; $self->extra }
56 multi method extra(Any $) { wantarray ? %{$self->_extra} : $self->_extra }