{"action":"created","issue":{"url":"https://api.github.com/repos/sfcgeorge/yard-contracts/issues/6","labels_url":"https://api.github.com/repos/sfcgeorge/yard-contracts/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/sfcgeorge/yard-contracts/issues/6/comments","events_url":"https://api.github.com/repos/sfcgeorge/yard-contracts/issues/6/events","html_url":"https://github.com/sfcgeorge/yard-contracts/issues/6","id":65663996,"number":6,"title":"Returning a hash has a weird rendering","user":{"login":"NobbZ","id":58951,"avatar_url":"https://avatars.githubusercontent.com/u/58951?v=3","gravatar_id":"","url":"https://api.github.com/users/NobbZ","html_url":"https://github.com/NobbZ","followers_url":"https://api.github.com/users/NobbZ/followers","following_url":"https://api.github.com/users/NobbZ/following{/other_user}","gists_url":"https://api.github.com/users/NobbZ/gists{/gist_id}","starred_url":"https://api.github.com/users/NobbZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NobbZ/subscriptions","organizations_url":"https://api.github.com/users/NobbZ/orgs","repos_url":"https://api.github.com/users/NobbZ/repos","events_url":"https://api.github.com/users/NobbZ/events{/privacy}","received_events_url":"https://api.github.com/users/NobbZ/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-01T11:32:27Z","updated_at":"2015-04-01T21:27:28Z","closed_at":null,"body":"Hi!\r\n\r\nI have the following (simplified) function and the generated documentation looks weird:\r\n\r\n```rb\r\nContract Token => {success: Bool, message: String}\r\ndef unlock token\r\n  {success: true, message: \"Yeah!\"}\r\nend\r\n```\r\n\r\nThe generated documentation shows up like following:\r\n\r\n> **Returns:**\r\n> * (`{:success=>Bool, :message=>String}`) - +:message=>String+\r\n\r\nAlso this function shows up twice! Once as a class method returning the Hash but taking no arguments and once as instance method returning `Object` and taking the argument `token` in the summaries.\r\n\r\nEven more strange is, that in the Class Method Details the parameter `token` is explained but not in the method head, the instance method is left undocumented but has the link to the source.\r\n\r\n**edit**\r\nThe promised screenshot:\r\n\r\n![Screenshot that shows the described problem](http://i.imgur.com/XIR2mJu.png)"},"comment":{"url":"https://api.github.com/repos/sfcgeorge/yard-contracts/issues/comments/88636030","html_url":"https://github.com/sfcgeorge/yard-contracts/issues/6#issuecomment-88636030","issue_url":"https://api.github.com/repos/sfcgeorge/yard-contracts/issues/6","id":88636030,"user":{"login":"sfcgeorge","id":885003,"avatar_url":"https://avatars.githubusercontent.com/u/885003?v=3","gravatar_id":"","url":"https://api.github.com/users/sfcgeorge","html_url":"https://github.com/sfcgeorge","followers_url":"https://api.github.com/users/sfcgeorge/followers","following_url":"https://api.github.com/users/sfcgeorge/following{/other_user}","gists_url":"https://api.github.com/users/sfcgeorge/gists{/gist_id}","starred_url":"https://api.github.com/users/sfcgeorge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sfcgeorge/subscriptions","organizations_url":"https://api.github.com/users/sfcgeorge/orgs","repos_url":"https://api.github.com/users/sfcgeorge/repos","events_url":"https://api.github.com/users/sfcgeorge/events{/privacy}","received_events_url":"https://api.github.com/users/sfcgeorge/received_events","type":"User","site_admin":false},"created_at":"2015-04-01T21:27:28Z","updated_at":"2015-04-01T21:27:28Z","body":"Hi, thanks for opening this issue. Wow that is weird in many ways. I've tested class and instance methods, they usually show up separately without duplication. Instance is the default so I have no idea why it would think it's a class method. \r\n\r\nShowing up twice makes perfect sense to me though. As the `Contract` call comes before the method,  yard-contracts has to stub out the method documentation with params, then YARD gets to the actual method and documents the rest. If yard-contracts has got it right, then YARD will merge it's method doc with the one from yard-contracts and all is well, no duplication. But as yard-contracts has mistakenly identified it as a class method it shows up once there, then YARD gets it right so it shows up again as instance. \r\n\r\nThe signature being wrong is explained because YARD fills that bit in. So the questions are, why does yard-contracts think it's a class method and why do hash return values get messed up. I'll look into it."}}