{"action":"created","issue":{"url":"https://api.github.com/repos/lasseebert/kase/issues/6","repository_url":"https://api.github.com/repos/lasseebert/kase","labels_url":"https://api.github.com/repos/lasseebert/kase/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/lasseebert/kase/issues/6/comments","events_url":"https://api.github.com/repos/lasseebert/kase/issues/6/events","html_url":"https://github.com/lasseebert/kase/issues/6","id":146534574,"number":6,"title":"More simple code without instance_eval","user":{"login":"lasseebert","id":728042,"avatar_url":"https://avatars.githubusercontent.com/u/728042?v=3","gravatar_id":"","url":"https://api.github.com/users/lasseebert","html_url":"https://github.com/lasseebert","followers_url":"https://api.github.com/users/lasseebert/followers","following_url":"https://api.github.com/users/lasseebert/following{/other_user}","gists_url":"https://api.github.com/users/lasseebert/gists{/gist_id}","starred_url":"https://api.github.com/users/lasseebert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lasseebert/subscriptions","organizations_url":"https://api.github.com/users/lasseebert/orgs","repos_url":"https://api.github.com/users/lasseebert/repos","events_url":"https://api.github.com/users/lasseebert/events{/privacy}","received_events_url":"https://api.github.com/users/lasseebert/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/lasseebert/kase/labels/bug","name":"bug","color":"ee0701"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2016-04-07T07:36:21Z","updated_at":"2016-04-10T19:07:09Z","closed_at":"2016-04-10T19:07:09Z","body":"We only use `instance_eval` to be able to use the `on` method inside the DSL.\r\n\r\nThis could be greatly simplified by not using `instance_eval` and instead yield the `Switcher` to the given block.\r\n\r\nSomething like this:\r\n\r\n```\r\nkase :ok do |k|\r\n  k.on(:ok) { do_something }\r\nend\r\n```\r\n\r\nWe could skip all the magic that happens with `method_missing` and copying of instance variables to make it work. It would be a lot easier to see what is going on, since we're then just operating on objects."},"comment":{"url":"https://api.github.com/repos/lasseebert/kase/issues/comments/208045690","html_url":"https://github.com/lasseebert/kase/issues/6#issuecomment-208045690","issue_url":"https://api.github.com/repos/lasseebert/kase/issues/6","id":208045690,"user":{"login":"lasseebert","id":728042,"avatar_url":"https://avatars.githubusercontent.com/u/728042?v=3","gravatar_id":"","url":"https://api.github.com/users/lasseebert","html_url":"https://github.com/lasseebert","followers_url":"https://api.github.com/users/lasseebert/followers","following_url":"https://api.github.com/users/lasseebert/following{/other_user}","gists_url":"https://api.github.com/users/lasseebert/gists{/gist_id}","starred_url":"https://api.github.com/users/lasseebert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lasseebert/subscriptions","organizations_url":"https://api.github.com/users/lasseebert/orgs","repos_url":"https://api.github.com/users/lasseebert/repos","events_url":"https://api.github.com/users/lasseebert/events{/privacy}","received_events_url":"https://api.github.com/users/lasseebert/received_events","type":"User","site_admin":false},"created_at":"2016-04-10T19:07:09Z","updated_at":"2016-04-10T19:07:09Z","body":"Closed in #7 "}}