2 class SQL::Translator::Object {
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 { {} },
43 multi method comments(Str $comment) { $self->add_comment($comment); $self->comments }
44 multi method comments(ArrayRef $comments) { $self->add_comment($_) for @$comments; $self->comments }
45 multi method comments(Any $) { wantarray ? @{$self->_comments} : join "\n", $self->_comments }
47 multi method options(Str $option) { $self->add_option($option); $self->options }
48 multi method options(ArrayRef $options) { $self->add_option($_) for @$options; $self->options }
49 multi method options(Any $) { wantarray ? @{$self->_options} : $self->_options }
51 multi method extra(Str $extra) { $self->get_extra($extra) }
52 multi method extra(HashRef $extra) { $self->add_extra($_, $extra->{$_}) for keys %$extra; $self->extra }
53 multi method extra(Any $) { wantarray ? %{$self->_extra} : $self->_extra }