Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's this _n_ Ruby koans?

Tags:

ruby

I'm trying out Ruby koans and found some tests using this _n_ , never seen it before what is it and how do I use it?

Example:

def test_objects_have_methods
           fido = Dog.new
           assert fido.methods.size > _n_
end

// John

like image 432
John Doe Avatar asked Oct 19 '10 11:10

John Doe


1 Answers

Found it:

 # Numeric replacement value.
    def _n_(value=999999, value19=:mu)
      if RUBY_VERSION < "1.9"
        value
      else
        (value19 == :mu) ? value : value19
      end
    end
like image 70
John Doe Avatar answered Oct 12 '22 03:10

John Doe