{"action":"opened","pull_request":{"review_comments":0,"created_at":"2011-12-12T18:11:51Z","state":"open","changed_files":1,"updated_at":"2011-12-12T18:11:51Z","_links":{"review_comments":{"href":"https://api.github.com/repos/bsiggelkow/jsonify/pulls/9/comments"},"comments":{"href":"https://api.github.com/repos/bsiggelkow/jsonify/issues/9/comments"},"html":{"href":"https://github.com/bsiggelkow/jsonify/pull/9"},"self":{"href":"https://api.github.com/repos/bsiggelkow/jsonify/pulls/9"}},"patch_url":"https://github.com/bsiggelkow/jsonify/pull/9.patch","issue_url":"https://github.com/bsiggelkow/jsonify/issues/9","user":{"gravatar_id":"5e943fa56803bb605bf6576ba2f5a3c1","id":623971,"url":"https://api.github.com/users/aparod","avatar_url":"https://secure.gravatar.com/avatar/5e943fa56803bb605bf6576ba2f5a3c1?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"aparod"},"comments":0,"deletions":1,"merged":false,"body":"I made a small change to make views a little simpler.  If a value responds to its key, call that method on the value and use the returned data as the value instead.  This helps make the view code a little more DRY.  Here's a before and after comparison:\r\n\r\n```ruby\r\n# Before\r\njson.users @users do |u|\r\n  json.id             u.id\r\n  json.username       u.username\r\n  json.first_name     u.first_name\r\n  json.last_name      u.last_name\r\nend\r\n\r\n# After\r\njson.users @users do |u|\r\n  json.id             u\r\n  json.username       u\r\n  json.first_name     u\r\n  json.last_name      u\r\nend\r\n```","commits":1,"mergeable":null,"id":584529,"base":{"user":{"gravatar_id":"f1a2bd46fe87c545fd7868aa39cea5cf","id":7837,"url":"https://api.github.com/users/bsiggelkow","avatar_url":"https://secure.gravatar.com/avatar/f1a2bd46fe87c545fd7868aa39cea5cf?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"bsiggelkow"},"repo":{"pushed_at":"2011-11-04T19:57:26Z","created_at":"2011-07-11T02:25:51Z","clone_url":"https://github.com/bsiggelkow/jsonify.git","updated_at":"2011-12-12T17:33:27Z","private":false,"watchers":122,"name":"jsonify","master_branch":null,"svn_url":"https://svn.github.com/bsiggelkow/jsonify","language":"Ruby","forks":5,"owner":{"gravatar_id":"f1a2bd46fe87c545fd7868aa39cea5cf","id":7837,"url":"https://api.github.com/users/bsiggelkow","avatar_url":"https://secure.gravatar.com/avatar/f1a2bd46fe87c545fd7868aa39cea5cf?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"bsiggelkow"},"id":2028193,"homepage":"http://jsonify.org","git_url":"git://github.com/bsiggelkow/jsonify.git","description":"JSON builder","html_url":"https://github.com/bsiggelkow/jsonify","url":"https://api.github.com/repos/bsiggelkow/jsonify","size":152,"fork":false,"open_issues":2,"ssh_url":"git@github.com:bsiggelkow/jsonify.git"},"sha":"752e658757f7c0836d617d56f3772350c63aae72","ref":"master","label":"bsiggelkow:master"},"additions":1,"number":9,"merged_by":null,"title":"Syntax improvement for views","head":{"user":{"gravatar_id":"5e943fa56803bb605bf6576ba2f5a3c1","id":623971,"url":"https://api.github.com/users/aparod","avatar_url":"https://secure.gravatar.com/avatar/5e943fa56803bb605bf6576ba2f5a3c1?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"aparod"},"repo":{"pushed_at":"2011-12-12T17:58:17Z","created_at":"2011-12-12T17:33:27Z","clone_url":"https://github.com/aparod/jsonify.git","updated_at":"2011-12-12T17:58:17Z","private":false,"watchers":1,"name":"jsonify","master_branch":null,"svn_url":"https://svn.github.com/aparod/jsonify","language":"Ruby","forks":0,"owner":{"gravatar_id":"5e943fa56803bb605bf6576ba2f5a3c1","id":623971,"url":"https://api.github.com/users/aparod","avatar_url":"https://secure.gravatar.com/avatar/5e943fa56803bb605bf6576ba2f5a3c1?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"aparod"},"id":2966043,"homepage":"http://jsonify.org","git_url":"git://github.com/aparod/jsonify.git","description":"JSON builder","html_url":"https://github.com/aparod/jsonify","url":"https://api.github.com/repos/aparod/jsonify","size":120,"fork":true,"open_issues":0,"ssh_url":"git@github.com:aparod/jsonify.git"},"sha":"797d8b2bfa13b954ee1ae9fc03ff15789e312811","ref":"master","label":"aparod:master"},"closed_at":null,"html_url":"https://github.com/bsiggelkow/jsonify/pull/9","diff_url":"https://github.com/bsiggelkow/jsonify/pull/9.diff","url":"https://api.github.com/repos/bsiggelkow/jsonify/pulls/9","merged_at":null},"number":9}