1 package SomeModelClassInterface;
3 use namespace::autoclean;
7 package SomeModelClass;
9 use CatalystX::ControllerGeneratingModel;
10 use DemoTypeLibrary qw/MessageDocument/;
11 use MooseX::Lexical::Types qw/MessageDocument/;
12 use namespace::autoclean;
14 # Note trivial calling convention.
15 # Apply MX::Method::Signatures and MX::Types::Structured to be less lame.
17 # Introspection should only reflect methods which satisfy the calling convention
18 # This is left as an exercise to the reader. :)
20 # Note command syntax not actually needed, this could be a normal sub,
21 # but doing so makes the eventual merge harder..
23 command say_hello => sub {
24 my ($self, $document) = @_;
26 my $name = $document->{name};
27 return({ type => 'say_hello_response',
29 body => "Hello $name" });
32 with 'SomeModelClassInterface';
34 before 'say_hello' => sub {
36 my MessageDocument $message = shift;
39 __PACKAGE__->meta->make_immutable;