{"action":"opened","issue":{"url":"https://api.github.com/repos/orgsync/active_interaction/issues/275","labels_url":"https://api.github.com/repos/orgsync/active_interaction/issues/275/labels{/name}","comments_url":"https://api.github.com/repos/orgsync/active_interaction/issues/275/comments","events_url":"https://api.github.com/repos/orgsync/active_interaction/issues/275/events","html_url":"https://github.com/orgsync/active_interaction/issues/275","id":70274400,"number":275,"title":"Add validations to constrain the return from execute","user":{"login":"atteeela","id":911814,"avatar_url":"https://avatars.githubusercontent.com/u/911814?v=3","gravatar_id":"","url":"https://api.github.com/users/atteeela","html_url":"https://github.com/atteeela","followers_url":"https://api.github.com/users/atteeela/followers","following_url":"https://api.github.com/users/atteeela/following{/other_user}","gists_url":"https://api.github.com/users/atteeela/gists{/gist_id}","starred_url":"https://api.github.com/users/atteeela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atteeela/subscriptions","organizations_url":"https://api.github.com/users/atteeela/orgs","repos_url":"https://api.github.com/users/atteeela/repos","events_url":"https://api.github.com/users/atteeela/events{/privacy}","received_events_url":"https://api.github.com/users/atteeela/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-23T01:14:41Z","updated_at":"2015-04-23T01:14:41Z","closed_at":null,"body":"It would be very useful to be able to constrain the return type of execute.\r\n\r\nIdeally it can be defined in a block like so:\r\n\r\n    class GetFavToppings < ActiveInteraction::Base\r\n    \r\n      returns do\r\n         string :topping_name\r\n         integer :weight\r\n      end\r\n\r\n      def execute\r\n        toppings.size\r\n      end\r\n    end\r\n"}}