How can I find a perfect square in Ruby? : I'm trying to write a method in ruby that checks whether a number is a perfect square.
This is my code at the moment:

    def is_square(x)
    return true if
    math.sqrt(x).is_a? Integer
    end

Any idea why it isn't working?

Thanks very much in advance
Sarah