2.1.3 :001 > require "./ex25.rb"
SyntaxError: /home/.../ruby/ex25.rb:1: class/module name must be CONSTANT
from /home/.../.rvm/rubies/ruby-2.1.3/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/.../.rvm/rubies/ruby-2.1.3/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from (irb):1
from /home/.../.rvm/rubies/ruby-2.1.3/bin/irb:11:in `<main>'
After going back and capitalizing the module name, function names and references to the functions, I was able to get it run without error.
2.1.3 :001 > require "./ex25.rb"
=> true
Found official documentation that discusses naming. The exercise didn't cover the topic of naming...
http://www.ruby-doc.org/docs/ruby-doc-bundle/UsersGuide/rg/constants.html
http://www.ruby-doc.org/docs/ruby-doc-bundle/UsersGuide/rg/constants.html
No comments:
Post a Comment