Why are these Ruby method calls not equivalent?-Collection of common programming errors
programming-amp-design Retrieving original web address
discoverer: Blake I’m learning Ruby and this tutorial I’m using says that these method calls are all equivalent but when I run it I get this error: Ruby_tests/method_diff.rb:6:in ”: undefined method ‘sayGoodnight’ for main:Object Here is the code from the tutorial: puts sayGoodnight “John-Boy” puts sayGoodnight(“John-Boy”) puts(sayGoodnight “John-Boy”)
puts(sayGoodnight(“John-Boy”))
-
Have you, in fact, defined the ‘sayGoodnight’ function?
Source of the problem: answers.yahoo
Web site is in building
Originally posted 2013-11-09 23:17:48.