From: Dave Rolsky Date: Tue, 31 Mar 2009 15:39:24 +0000 (-0500) Subject: Move methods so they are in order of use X-Git-Tag: 0.73_01~18 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b905f0db5ee2fbc7a423da9eebadbc22d89e861a;p=gitmo%2FMoose.git Move methods so they are in order of use --- diff --git a/lib/Moose/Meta/Method/Constructor.pm b/lib/Moose/Meta/Method/Constructor.pm index 4205c38..1c60f63 100644 --- a/lib/Moose/Meta/Method/Constructor.pm +++ b/lib/Moose/Meta/Method/Constructor.pm @@ -115,24 +115,6 @@ sub attributes { (shift)->{'attributes'} } ## method -sub _generate_params { - my ( $self, $var, $class_var ) = @_; - "my $var = " . $self->_generate_BUILDARGS( $class_var, '@_' ) . ";\n"; -} - -sub _generate_instance { - my ( $self, $var, $class_var ) = @_; - "my $var = " - . $self->meta_instance->inline_create_instance($class_var) . ";\n"; -} - -sub _generate_slot_initializers { - my ($self) = @_; - return (join ";\n" => map { - $self->_generate_slot_initializer($_) - } 0 .. (@{$self->attributes} - 1)) . ";\n"; -} - sub initialize_body { my $self = shift; # TODO: @@ -192,6 +174,24 @@ sub initialize_body { $self->{'body'} = $code; } +sub _generate_params { + my ( $self, $var, $class_var ) = @_; + "my $var = " . $self->_generate_BUILDARGS( $class_var, '@_' ) . ";\n"; +} + +sub _generate_instance { + my ( $self, $var, $class_var ) = @_; + "my $var = " + . $self->meta_instance->inline_create_instance($class_var) . ";\n"; +} + +sub _generate_slot_initializers { + my ($self) = @_; + return (join ";\n" => map { + $self->_generate_slot_initializer($_) + } 0 .. (@{$self->attributes} - 1)) . ";\n"; +} + sub _generate_BUILDARGS { my ( $self, $class, $args ) = @_;