{"action":"closed","issue":{"url":"https://api.github.com/repos/egonSchiele/contracts.ruby/issues/146","labels_url":"https://api.github.com/repos/egonSchiele/contracts.ruby/issues/146/labels{/name}","comments_url":"https://api.github.com/repos/egonSchiele/contracts.ruby/issues/146/comments","events_url":"https://api.github.com/repos/egonSchiele/contracts.ruby/issues/146/events","html_url":"https://github.com/egonSchiele/contracts.ruby/issues/146","id":74478425,"number":146,"title":"Contract on method initialize raises NameError","user":{"login":"Burdette-at-R1Soft","id":9483668,"avatar_url":"https://avatars.githubusercontent.com/u/9483668?v=3","gravatar_id":"","url":"https://api.github.com/users/Burdette-at-R1Soft","html_url":"https://github.com/Burdette-at-R1Soft","followers_url":"https://api.github.com/users/Burdette-at-R1Soft/followers","following_url":"https://api.github.com/users/Burdette-at-R1Soft/following{/other_user}","gists_url":"https://api.github.com/users/Burdette-at-R1Soft/gists{/gist_id}","starred_url":"https://api.github.com/users/Burdette-at-R1Soft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Burdette-at-R1Soft/subscriptions","organizations_url":"https://api.github.com/users/Burdette-at-R1Soft/orgs","repos_url":"https://api.github.com/users/Burdette-at-R1Soft/repos","events_url":"https://api.github.com/users/Burdette-at-R1Soft/events{/privacy}","received_events_url":"https://api.github.com/users/Burdette-at-R1Soft/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-08T20:07:00Z","updated_at":"2015-05-08T20:31:26Z","closed_at":"2015-05-08T20:31:26Z","body":"I've found everything I need in the gem, with one exception:  I have not been able to put a contract onto an initialize method.\r\n\r\nIs that expected?\r\n\r\nHere's some irb:\r\n\r\nC:\\Users\\Burdette.Lamar>irb\r\nirb(main):001:0> require 'contracts'\r\n=> true\r\nirb(main):002:0> class Foo\r\nirb(main):003:1> include Contracts\r\nirb(main):004:1> Contract None => nil\r\nirb(main):005:1> def initialize\r\nirb(main):006:2> end\r\nirb(main):007:1> end\r\nNameError: undefined method `Foo' for class `Foo'\r\n        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/contracts-0.6/lib/contracts/method_reference.rb:27:in `private'\r\n        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/contracts-0.6/lib/contracts/method_reference.rb:27:in `block in make_private'\r\n        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/contracts-0.6/lib/contracts/method_reference.rb:27:in `class_eval'\r\n        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/contracts-0.6/lib/contracts/method_reference.rb:27:in `make_private'\r\n        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/contracts-0.6/lib/contracts/decorators.rb:174:in `common_method_added'\r\n        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/contracts-0.6/lib/contracts/decorators.rb:33:in `method_added'\r\n        from (irb):5:in `<class:Foo>'\r\n        from (irb):2\r\n        from C:/Ruby193/bin/irb:12:in `<main>'\r\nirb(main):008:0>"}}