{"action":"closed","issue":{"url":"https://api.github.com/repos/rails/rails/issues/23824","repository_url":"https://api.github.com/repos/rails/rails","labels_url":"https://api.github.com/repos/rails/rails/issues/23824/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/23824/comments","events_url":"https://api.github.com/repos/rails/rails/issues/23824/events","html_url":"https://github.com/rails/rails/issues/23824","id":135751753,"number":23824,"title":"Add Module#delegate_missing_to","user":{"login":"dhh","id":2741,"avatar_url":"https://avatars.githubusercontent.com/u/2741?v=3","gravatar_id":"","url":"https://api.github.com/users/dhh","html_url":"https://github.com/dhh","followers_url":"https://api.github.com/users/dhh/followers","following_url":"https://api.github.com/users/dhh/following{/other_user}","gists_url":"https://api.github.com/users/dhh/gists{/gist_id}","starred_url":"https://api.github.com/users/dhh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhh/subscriptions","organizations_url":"https://api.github.com/users/dhh/orgs","repos_url":"https://api.github.com/users/dhh/repos","events_url":"https://api.github.com/users/dhh/events{/privacy}","received_events_url":"https://api.github.com/users/dhh/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rails/rails/labels/activesupport","name":"activesupport","color":"FC9300"},{"url":"https://api.github.com/repos/rails/rails/labels/attached%20PR","name":"attached PR","color":"006b75"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/rails/rails/milestones/49","html_url":"https://github.com/rails/rails/milestones/5.1.0","labels_url":"https://api.github.com/repos/rails/rails/milestones/49/labels","id":1601639,"number":49,"title":"5.1.0","description":"","creator":{"login":"rafaelfranca","id":47848,"avatar_url":"https://avatars.githubusercontent.com/u/47848?v=3","gravatar_id":"","url":"https://api.github.com/users/rafaelfranca","html_url":"https://github.com/rafaelfranca","followers_url":"https://api.github.com/users/rafaelfranca/followers","following_url":"https://api.github.com/users/rafaelfranca/following{/other_user}","gists_url":"https://api.github.com/users/rafaelfranca/gists{/gist_id}","starred_url":"https://api.github.com/users/rafaelfranca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafaelfranca/subscriptions","organizations_url":"https://api.github.com/users/rafaelfranca/orgs","repos_url":"https://api.github.com/users/rafaelfranca/repos","events_url":"https://api.github.com/users/rafaelfranca/events{/privacy}","received_events_url":"https://api.github.com/users/rafaelfranca/received_events","type":"User","site_admin":false},"open_issues":15,"closed_issues":3,"state":"open","created_at":"2016-02-24T03:19:34Z","updated_at":"2016-05-24T21:45:52Z","due_on":null,"closed_at":null},"comments":9,"created_at":"2016-02-23T14:29:42Z","updated_at":"2016-05-24T21:45:52Z","closed_at":"2016-05-24T21:45:52Z","body":"Here's a common pattern if you want to build a decorator:\r\n\r\n```ruby\r\n    class Partition\r\n      def initialize(first_event)\r\n        @events = [ first_event ]\r\n      end\r\n\r\n      def people\r\n        if @events.first.detail.people.any?\r\n          @events.collect { |e| Array(e.detail.people) }.flatten.uniq\r\n        else\r\n          @events.collect(&:creator).uniq\r\n        end\r\n      end\r\n\r\n      private\r\n        def respond_to_missing?(name, include_private = false)\r\n          @events.respond_to?(name, include_private)\r\n        end\r\n\r\n        def method_missing(method, *args, &block)\r\n          @events.send(method, *args, &block)\r\n        end\r\n    end\r\n```\r\n\r\nWould be nice to have it as:\r\n\r\n```ruby\r\n    class Partition\r\n      delegate_missing_to :@events\r\n\r\n      def initialize(first_event)\r\n        @events = [ first_event ]\r\n      end\r\n\r\n      def people\r\n        if @events.first.detail.people.any?\r\n          @events.collect { |e| Array(e.detail.people) }.flatten.uniq\r\n        else\r\n          @events.collect(&:creator).uniq\r\n        end\r\n      end\r\n    end\r\n```"}}
{"actor":{"display_login":"rafaelfranca"}}