Remove the types stuff
[catagits/CatalystX-DynamicComponent.git] / t / lib / SomeModelClass.pm
index e956815..83f7271 100644 (file)
@@ -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;