{"action":"created","issue":{"url":"https://api.github.com/repos/makersacademy/problem-solving/issues/88","repository_url":"https://api.github.com/repos/makersacademy/problem-solving","labels_url":"https://api.github.com/repos/makersacademy/problem-solving/issues/88/labels{/name}","comments_url":"https://api.github.com/repos/makersacademy/problem-solving/issues/88/comments","events_url":"https://api.github.com/repos/makersacademy/problem-solving/issues/88/events","html_url":"https://github.com/makersacademy/problem-solving/issues/88","id":238841457,"number":88,"title":"private method 'fizzbuzz' called","user":{"login":"SaphMB","id":9513073,"avatar_url":"https://avatars1.githubusercontent.com/u/9513073?v=3","gravatar_id":"","url":"https://api.github.com/users/SaphMB","html_url":"https://github.com/SaphMB","followers_url":"https://api.github.com/users/SaphMB/followers","following_url":"https://api.github.com/users/SaphMB/following{/other_user}","gists_url":"https://api.github.com/users/SaphMB/gists{/gist_id}","starred_url":"https://api.github.com/users/SaphMB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SaphMB/subscriptions","organizations_url":"https://api.github.com/users/SaphMB/orgs","repos_url":"https://api.github.com/users/SaphMB/repos","events_url":"https://api.github.com/users/SaphMB/events{/privacy}","received_events_url":"https://api.github.com/users/SaphMB/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-06-27T12:56:00Z","updated_at":"2017-06-27T13:30:27Z","closed_at":null,"body":"Hi, when using the alternative version of the rspec test:\r\n\r\nit 'returns \"fizz\" for the number 3' do\r\n  expect(3.fizzbuzz).to eq 'fizz'\r\nend\r\n\r\nI'm getting the below error:\r\n\r\n     Failure/Error: expect(3.fizzbuzz).to eq 'fizz'\r\n     \r\n     NoMethodError:\r\n       private method `fizzbuzz' called for 3:Fixnum\r\n     # ./spec/fizzbuzz_spec.rb:5:in `block (2 levels) in <top (required)>'\r\n\r\nDoes anyone have any insight?"},"comment":{"url":"https://api.github.com/repos/makersacademy/problem-solving/issues/comments/311358431","html_url":"https://github.com/makersacademy/problem-solving/issues/88#issuecomment-311358431","issue_url":"https://api.github.com/repos/makersacademy/problem-solving/issues/88","id":311358431,"user":{"login":"paulmillen","id":25769263,"avatar_url":"https://avatars2.githubusercontent.com/u/25769263?v=3","gravatar_id":"","url":"https://api.github.com/users/paulmillen","html_url":"https://github.com/paulmillen","followers_url":"https://api.github.com/users/paulmillen/followers","following_url":"https://api.github.com/users/paulmillen/following{/other_user}","gists_url":"https://api.github.com/users/paulmillen/gists{/gist_id}","starred_url":"https://api.github.com/users/paulmillen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulmillen/subscriptions","organizations_url":"https://api.github.com/users/paulmillen/orgs","repos_url":"https://api.github.com/users/paulmillen/repos","events_url":"https://api.github.com/users/paulmillen/events{/privacy}","received_events_url":"https://api.github.com/users/paulmillen/received_events","type":"User","site_admin":false},"created_at":"2017-06-27T13:30:27Z","updated_at":"2017-06-27T13:30:27Z","body":"As I understand it, when you call an argument using the argument.method structure, this will only work if the object (that is the argument) is allowed to use that method.  ie is this private method something which is in the scope of its class?\r\n\r\nThe error message you are getting is Ruby saying \"fizbuzz isn't a method for 3 (which is an object of the Fixnum class).\r\n\r\nTo call the method like this you have to give the method to the class in question, and structure the method to use the \"self\" keyword, so:\r\n\r\n```\r\nclass Fixnum\r\n  def fizzbuzz\r\n   puts \"fizz\" if self % 3 == 0\r\n  end\r\nend\r\n```\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"paulmillen"}}