X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FSomeModelClass.pm;h=83f7271302f40af6f79ae23164bdfaa903df8475;hb=e36ac2860af760b347657caeb1b2fccfd3353323;hp=e956815a3ecd241f3324902884dfce10dc82eeef;hpb=e611cf43e02a034794beab870974d63708980e62;p=catagits%2FCatalystX-DynamicComponent.git diff --git a/t/lib/SomeModelClass.pm b/t/lib/SomeModelClass.pm index e956815..83f7271 100644 --- a/t/lib/SomeModelClass.pm +++ b/t/lib/SomeModelClass.pm @@ -1,3 +1,9 @@ +package SomeModelClassInterface; +use Moose::Role; +use namespace::autoclean; + +requires 'say_hello'; + package SomeModelClass; use Moose; use CatalystX::ControllerGeneratingModel; @@ -9,10 +15,19 @@ use namespace::autoclean; # Introspection should only reflect methods which satisfy the calling convention # This is left as an exercise to the reader. :) +# Note command syntax not actually needed, this could be a normal sub, +# but doing so makes the eventual merge harder.. + command say_hello => sub { - my ($self, $name) = @_; - return("Hello $name"); + my ($self, $document) = @_; + + my $name = $document->{name}; + return({ type => 'say_hello_response', + + body => "Hello $name" }); }; +with 'SomeModelClassInterface'; + __PACKAGE__->meta->make_immutable;