{"action":"created","issue":{"url":"https://api.github.com/repos/Integralist/Sinderella/issues/3","labels_url":"https://api.github.com/repos/Integralist/Sinderella/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/Integralist/Sinderella/issues/3/comments","events_url":"https://api.github.com/repos/Integralist/Sinderella/issues/3/events","html_url":"https://github.com/Integralist/Sinderella/issues/3","id":93155128,"number":3,"title":"Why tap?","user":{"login":"justin808","id":1118459,"avatar_url":"https://avatars.githubusercontent.com/u/1118459?v=3","gravatar_id":"","url":"https://api.github.com/users/justin808","html_url":"https://github.com/justin808","followers_url":"https://api.github.com/users/justin808/followers","following_url":"https://api.github.com/users/justin808/following{/other_user}","gists_url":"https://api.github.com/users/justin808/gists{/gist_id}","starred_url":"https://api.github.com/users/justin808/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justin808/subscriptions","organizations_url":"https://api.github.com/users/justin808/orgs","repos_url":"https://api.github.com/users/justin808/repos","events_url":"https://api.github.com/users/justin808/events{/privacy}","received_events_url":"https://api.github.com/users/justin808/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-05T23:09:24Z","updated_at":"2015-07-08T07:49:31Z","closed_at":null,"body":"Why does the example require `tap`?\r\n\r\n```ruby\r\nid = Sinderella.transforms(data, till_midnight) do |data|\r\n  data.each do |key, value|\r\n    data.tap { |d| d[key].upcase! }\r\n  end\r\nend\r\n```\r\n\r\nSeems that the code is the same as:\r\n```ruby\r\nid = Sinderella.transforms(data, till_midnight) do |deep_cloned_data|\r\n  deep_cloned_data.each do |key, value|\r\n    deep_cloned_data[key].upcase! # modifying the deep cloned values\r\n  end\r\nend\r\n```\r\n\r\nSome linters flag the use of data in the block as an error.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Integralist/Sinderella/issues/comments/119474219","html_url":"https://github.com/Integralist/Sinderella/issues/3#issuecomment-119474219","issue_url":"https://api.github.com/repos/Integralist/Sinderella/issues/3","id":119474219,"user":{"login":"Integralist","id":180050,"avatar_url":"https://avatars.githubusercontent.com/u/180050?v=3","gravatar_id":"","url":"https://api.github.com/users/Integralist","html_url":"https://github.com/Integralist","followers_url":"https://api.github.com/users/Integralist/followers","following_url":"https://api.github.com/users/Integralist/following{/other_user}","gists_url":"https://api.github.com/users/Integralist/gists{/gist_id}","starred_url":"https://api.github.com/users/Integralist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Integralist/subscriptions","organizations_url":"https://api.github.com/users/Integralist/orgs","repos_url":"https://api.github.com/users/Integralist/repos","events_url":"https://api.github.com/users/Integralist/events{/privacy}","received_events_url":"https://api.github.com/users/Integralist/received_events","type":"User","site_admin":false},"created_at":"2015-07-08T07:49:31Z","updated_at":"2015-07-08T07:49:31Z","body":"Hi @justin808 thanks for the comment.\r\n\r\nI must admit it does indeed look like it should work perfectly well without the `tap`. I've not tried your example, so I assume it works still and the specs pass with that modification applied.\r\n\r\nI do remember there being an issue that required me to `tap`, but to be completely honest I can't quite recall what the reasoning was (it's been nearly a year and a half since I wrote that code, so my memory is a little hazy).\r\n\r\nIf I get a chance I'll look at that and ping another response here, otherwise I'll likely modify the code to reflect your suggested refactor."}}