{"action":"created","issue":{"url":"https://api.github.com/repos/hanami/controller/issues/145","repository_url":"https://api.github.com/repos/hanami/controller","labels_url":"https://api.github.com/repos/hanami/controller/issues/145/labels{/name}","comments_url":"https://api.github.com/repos/hanami/controller/issues/145/comments","events_url":"https://api.github.com/repos/hanami/controller/issues/145/events","html_url":"https://github.com/hanami/controller/pull/145","id":142662917,"number":145,"title":"Fix Ruby warnings","user":{"login":"jodosha","id":5089,"avatar_url":"https://avatars.githubusercontent.com/u/5089?v=3","gravatar_id":"","url":"https://api.github.com/users/jodosha","html_url":"https://github.com/jodosha","followers_url":"https://api.github.com/users/jodosha/followers","following_url":"https://api.github.com/users/jodosha/following{/other_user}","gists_url":"https://api.github.com/users/jodosha/gists{/gist_id}","starred_url":"https://api.github.com/users/jodosha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jodosha/subscriptions","organizations_url":"https://api.github.com/users/jodosha/orgs","repos_url":"https://api.github.com/users/jodosha/repos","events_url":"https://api.github.com/users/jodosha/events{/privacy}","received_events_url":"https://api.github.com/users/jodosha/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hanami/controller/labels/fix","name":"fix","color":"009800"},{"url":"https://api.github.com/repos/hanami/controller/labels/ruby-warnings","name":"ruby-warnings","color":"eb6420"}],"state":"open","locked":false,"assignee":{"login":"jodosha","id":5089,"avatar_url":"https://avatars.githubusercontent.com/u/5089?v=3","gravatar_id":"","url":"https://api.github.com/users/jodosha","html_url":"https://github.com/jodosha","followers_url":"https://api.github.com/users/jodosha/followers","following_url":"https://api.github.com/users/jodosha/following{/other_user}","gists_url":"https://api.github.com/users/jodosha/gists{/gist_id}","starred_url":"https://api.github.com/users/jodosha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jodosha/subscriptions","organizations_url":"https://api.github.com/users/jodosha/orgs","repos_url":"https://api.github.com/users/jodosha/repos","events_url":"https://api.github.com/users/jodosha/events{/privacy}","received_events_url":"https://api.github.com/users/jodosha/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/hanami/controller/milestones/16","html_url":"https://github.com/hanami/controller/milestones/next","labels_url":"https://api.github.com/repos/hanami/controller/milestones/16/labels","id":1596469,"number":16,"title":"next","description":"","creator":{"login":"jodosha","id":5089,"avatar_url":"https://avatars.githubusercontent.com/u/5089?v=3","gravatar_id":"","url":"https://api.github.com/users/jodosha","html_url":"https://github.com/jodosha","followers_url":"https://api.github.com/users/jodosha/followers","following_url":"https://api.github.com/users/jodosha/following{/other_user}","gists_url":"https://api.github.com/users/jodosha/gists{/gist_id}","starred_url":"https://api.github.com/users/jodosha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jodosha/subscriptions","organizations_url":"https://api.github.com/users/jodosha/orgs","repos_url":"https://api.github.com/users/jodosha/repos","events_url":"https://api.github.com/users/jodosha/events{/privacy}","received_events_url":"https://api.github.com/users/jodosha/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":0,"state":"open","created_at":"2016-02-22T08:37:13Z","updated_at":"2016-03-22T14:14:26Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2016-03-22T14:14:26Z","updated_at":"2016-03-22T14:24:19Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hanami/controller/pulls/145","html_url":"https://github.com/hanami/controller/pull/145","diff_url":"https://github.com/hanami/controller/pull/145.diff","patch_url":"https://github.com/hanami/controller/pull/145.patch"},"body":"/cc @hanami/core-team @hanami/contributors "},"comment":{"url":"https://api.github.com/repos/hanami/controller/issues/comments/199837574","html_url":"https://github.com/hanami/controller/pull/145#issuecomment-199837574","issue_url":"https://api.github.com/repos/hanami/controller/issues/145","id":199837574,"user":{"login":"jodosha","id":5089,"avatar_url":"https://avatars.githubusercontent.com/u/5089?v=3","gravatar_id":"","url":"https://api.github.com/users/jodosha","html_url":"https://github.com/jodosha","followers_url":"https://api.github.com/users/jodosha/followers","following_url":"https://api.github.com/users/jodosha/following{/other_user}","gists_url":"https://api.github.com/users/jodosha/gists{/gist_id}","starred_url":"https://api.github.com/users/jodosha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jodosha/subscriptions","organizations_url":"https://api.github.com/users/jodosha/orgs","repos_url":"https://api.github.com/users/jodosha/repos","events_url":"https://api.github.com/users/jodosha/events{/privacy}","received_events_url":"https://api.github.com/users/jodosha/received_events","type":"User","site_admin":false},"created_at":"2016-03-22T14:24:19Z","updated_at":"2016-03-22T14:24:19Z","body":"@davydovanton Due the dynamic nature of Ruby, a non-initialized variable is equivalent to `nil`. But referencing non-initialized instance variables emits a warning.\r\n\r\n```ruby\r\nclass Foo\r\n  def bar\r\n    @bar || 42\r\n  end\r\nend\r\n```\r\n\r\nTo fix the warning:\r\n\r\n```ruby\r\nclass Foo\r\n  def initialize\r\n    @bar = nil\r\n  end\r\n\r\n  def bar\r\n    @bar || 42\r\n  end\r\nend\r\n```\r\n\r\nThe public API to set that value\r\nis defined by https://github.com/hanami/controller/blob/fix-ruby-warnings/lib/hanami/action/cache/cache_control.rb#L28 and https://github.com/hanami/controller/blob/fix-ruby-warnings/lib/hanami/action/cache/cache_control.rb#L32"}}