{"action":"created","issue":{"url":"https://api.github.com/repos/makersacademy/ruby-kickstart/issues/226","labels_url":"https://api.github.com/repos/makersacademy/ruby-kickstart/issues/226/labels{/name}","comments_url":"https://api.github.com/repos/makersacademy/ruby-kickstart/issues/226/comments","events_url":"https://api.github.com/repos/makersacademy/ruby-kickstart/issues/226/events","html_url":"https://github.com/makersacademy/ruby-kickstart/issues/226","id":123184495,"number":226,"title":"2:12 - Fractions","user":{"login":"Jeremy-Barrass","id":6475803,"avatar_url":"https://avatars.githubusercontent.com/u/6475803?v=3","gravatar_id":"","url":"https://api.github.com/users/Jeremy-Barrass","html_url":"https://github.com/Jeremy-Barrass","followers_url":"https://api.github.com/users/Jeremy-Barrass/followers","following_url":"https://api.github.com/users/Jeremy-Barrass/following{/other_user}","gists_url":"https://api.github.com/users/Jeremy-Barrass/gists{/gist_id}","starred_url":"https://api.github.com/users/Jeremy-Barrass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jeremy-Barrass/subscriptions","organizations_url":"https://api.github.com/users/Jeremy-Barrass/orgs","repos_url":"https://api.github.com/users/Jeremy-Barrass/repos","events_url":"https://api.github.com/users/Jeremy-Barrass/events{/privacy}","received_events_url":"https://api.github.com/users/Jeremy-Barrass/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-20T21:31:04Z","updated_at":"2015-12-21T09:31:09Z","closed_at":null,"body":"I'm feeling very stuck, especially as the user AlexAvlontis who posted an issue about this challenge seemed to have a completely different challenge to the one I'm working on.\r\n\r\nAnyway, my code keeps blowing up here:\r\n\r\n```\r\ndef lowest\r\n    puts \"lowest method is running\"\r\n    puts \"Calculating numerator gcd\"\r\n  \t@numerator = self.gcd @numerator, @denominator\r\n    puts \"Numerator gcd calculation complete\"\r\n    puts @numerator # => produces a blank line\r\n    puts \"Calculating denominator gcd\"\r\n  \t@denominator = self.gcd @denominator, @numerator \r\n    puts \"Denominator calculation complete\"\r\n    puts \"lowest method is complete\"\r\n    return @numerator, @denominator\r\nend\r\n\r\ndef gcd(a,b) => # => Running from: puts \"Calculating denominator gcd\" : @denominator = self.gcd @denominator, @numerator \r\n    puts \"gcd method is running\"     \r\n    return a if b == 0\r\n    self.gcd(b, a%b) # => Throws the error: `%': nil can't be coerced into Float (TypeError)\r\n    puts \"gcd method is complete\"\r\n  end\r\n\r\n```\r\n\r\nI think I've misunderstood how fractions work, but it seems that the @numerator variable being passed to the gcd methods \"b\" parameter has nothng in it... which on further testing is indeed the case, as calling \"puts\" on it produces a blank line.  Let me go and revise basic mathematics, but can anyone shed light on why @numerator is being calculated to an empty variable by the code I'm currently using?"},"comment":{"url":"https://api.github.com/repos/makersacademy/ruby-kickstart/issues/comments/166245884","html_url":"https://github.com/makersacademy/ruby-kickstart/issues/226#issuecomment-166245884","issue_url":"https://api.github.com/repos/makersacademy/ruby-kickstart/issues/226","id":166245884,"user":{"login":"tcpickard94","id":11836134,"avatar_url":"https://avatars.githubusercontent.com/u/11836134?v=3","gravatar_id":"","url":"https://api.github.com/users/tcpickard94","html_url":"https://github.com/tcpickard94","followers_url":"https://api.github.com/users/tcpickard94/followers","following_url":"https://api.github.com/users/tcpickard94/following{/other_user}","gists_url":"https://api.github.com/users/tcpickard94/gists{/gist_id}","starred_url":"https://api.github.com/users/tcpickard94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tcpickard94/subscriptions","organizations_url":"https://api.github.com/users/tcpickard94/orgs","repos_url":"https://api.github.com/users/tcpickard94/repos","events_url":"https://api.github.com/users/tcpickard94/events{/privacy}","received_events_url":"https://api.github.com/users/tcpickard94/received_events","type":"User","site_admin":false},"created_at":"2015-12-21T09:31:09Z","updated_at":"2015-12-21T09:31:09Z","body":"In your lowest method you need to call the class again. i.e Fraction.new(lnumerator, ldenominator)"}}