{"action":"created","issue":{"url":"https://api.github.com/repos/manastech/crystal/issues/393","labels_url":"https://api.github.com/repos/manastech/crystal/issues/393/labels{/name}","comments_url":"https://api.github.com/repos/manastech/crystal/issues/393/comments","events_url":"https://api.github.com/repos/manastech/crystal/issues/393/events","html_url":"https://github.com/manastech/crystal/pull/393","id":56578162,"number":393,"title":"Added Enumerable#last","user":{"login":"Exilor","id":5578107,"avatar_url":"https://avatars.githubusercontent.com/u/5578107?v=3","gravatar_id":"","url":"https://api.github.com/users/Exilor","html_url":"https://github.com/Exilor","followers_url":"https://api.github.com/users/Exilor/followers","following_url":"https://api.github.com/users/Exilor/following{/other_user}","gists_url":"https://api.github.com/users/Exilor/gists{/gist_id}","starred_url":"https://api.github.com/users/Exilor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Exilor/subscriptions","organizations_url":"https://api.github.com/users/Exilor/orgs","repos_url":"https://api.github.com/users/Exilor/repos","events_url":"https://api.github.com/users/Exilor/events{/privacy}","received_events_url":"https://api.github.com/users/Exilor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-04T19:52:18Z","updated_at":"2015-02-05T12:53:27Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/manastech/crystal/pulls/393","html_url":"https://github.com/manastech/crystal/pull/393","diff_url":"https://github.com/manastech/crystal/pull/393.diff","patch_url":"https://github.com/manastech/crystal/pull/393.patch"},"body":"This method's main purpose is to spare us from things like\r\n```ruby\r\nlast = range.end\r\nlast -= 1 if range.excludes_end?\r\n```\r\nwhich is a common sight in methods that take ranges as arguments.\r\nIt could be added to Range instead but I think it's a good idea to provide a method to get the last element for enumerable classses in general since there's already one to get the first."},"comment":{"url":"https://api.github.com/repos/manastech/crystal/issues/comments/73041277","html_url":"https://github.com/manastech/crystal/pull/393#issuecomment-73041277","issue_url":"https://api.github.com/repos/manastech/crystal/issues/393","id":73041277,"user":{"login":"jhass","id":141294,"avatar_url":"https://avatars.githubusercontent.com/u/141294?v=3","gravatar_id":"","url":"https://api.github.com/users/jhass","html_url":"https://github.com/jhass","followers_url":"https://api.github.com/users/jhass/followers","following_url":"https://api.github.com/users/jhass/following{/other_user}","gists_url":"https://api.github.com/users/jhass/gists{/gist_id}","starred_url":"https://api.github.com/users/jhass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhass/subscriptions","organizations_url":"https://api.github.com/users/jhass/orgs","repos_url":"https://api.github.com/users/jhass/repos","events_url":"https://api.github.com/users/jhass/events{/privacy}","received_events_url":"https://api.github.com/users/jhass/received_events","type":"User","site_admin":false},"created_at":"2015-02-05T12:53:27Z","updated_at":"2015-02-05T12:53:27Z","body":"How about\r\n```\r\ndef last\r\n    @exclusive ? super : @end\r\nend\r\n```\r\n\r\nI think that case is common enough to give a huge advantage."}}